<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.6/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.6/ http://www.mediawiki.org/xml/export-0.6.xsd" version="0.6" xml:lang="en">
  <siteinfo>
    <sitename>Blood Wiki</sitename>
    <base>http://omnicide.legacy-of-kain.ru/w/index.php/Main_Page</base>
    <generator>MediaWiki 1.19.1</generator>
    <case>first-letter</case>
    <namespaces>
      <namespace key="-2" case="first-letter">Media</namespace>
      <namespace key="-1" case="first-letter">Special</namespace>
      <namespace key="0" case="first-letter" />
      <namespace key="1" case="first-letter">Talk</namespace>
      <namespace key="2" case="first-letter">User</namespace>
      <namespace key="3" case="first-letter">User talk</namespace>
      <namespace key="4" case="first-letter">BloodWiki</namespace>
      <namespace key="5" case="first-letter">BloodWiki talk</namespace>
      <namespace key="6" case="first-letter">File</namespace>
      <namespace key="7" case="first-letter">File talk</namespace>
      <namespace key="8" case="first-letter">MediaWiki</namespace>
      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
      <namespace key="10" case="first-letter">Template</namespace>
      <namespace key="11" case="first-letter">Template talk</namespace>
      <namespace key="12" case="first-letter">Help</namespace>
      <namespace key="13" case="first-letter">Help talk</namespace>
      <namespace key="14" case="first-letter">Category</namespace>
      <namespace key="15" case="first-letter">Category talk</namespace>
    </namespaces>
  </siteinfo>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
      <sha1>lg8kc9k8uzncpgh3k3vri78imvoxc6m</sha1>
    <revision>
      <id>1</id>
      <timestamp>2012-07-02T11:36:39Z</timestamp>
      <contributor>
        <username>MediaWiki default</username>
        <id>0</id>
      </contributor>
      <text xml:space="preserve" bytes="423">'''MediaWiki has been successfully installed.'''

Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.

== Getting started ==
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]</text>
    </revision>
    <revision>
      <id>2</id>
      <timestamp>2012-07-02T11:45:23Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Getting started */</comment>
      <text xml:space="preserve" bytes="160">'''MediaWiki has been successfully installed.'''

Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.</text>
    </revision>
    <revision>
      <id>3</id>
      <timestamp>2012-07-02T11:45:38Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>4</id>
      <timestamp>2012-07-02T11:50:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3">'V'</text>
    </revision>
    <revision>
      <id>5</id>
      <timestamp>2012-07-02T11:50:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7">'''V'''</text>
    </revision>
    <revision>
      <id>6</id>
      <timestamp>2012-07-02T11:52:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>Reverted edits by [[Special:Contributions/VorteX|VorteX]] ([[User talk:VorteX|talk]]) to last revision by [[User:212.232.33.42|212.232.33.42]]</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>7</id>
      <timestamp>2012-07-02T12:07:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="39">''''Blood Omnicide Development Wiki''''</text>
    </revision>
    <revision>
      <id>8</id>
      <timestamp>2012-07-02T12:08:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="39">=== Blood Omnicide Development Wiki ===</text>
    </revision>
    <revision>
      <id>9</id>
      <timestamp>2012-07-02T12:26:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="543">== Topics ==
'''General'''
Most common information and frequently asked questions
'''Engine'''
Documents concerning usage of Darkplaces engine
'''Decorator'''
Information to work with Decorator - Blood Omnicide ingame editor
'''NetRadiant'''
Documents concerning NetRadiant - Blood Omnicide level editor
'''Modelling'''
Documents and topics about modelling, model formats and engine tricks
'''Scripting'''
Game scripts editing (not QuakeC)
'''Texture'''
Topics about textures, supported texture formats
'''Tools'''
Special Blood Omnicide tools</text>
    </revision>
    <revision>
      <id>10</id>
      <timestamp>2012-07-02T12:29:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Topics */</comment>
      <text xml:space="preserve" bytes="589">== Topics ==
'''General'''

:Most common information and frequently asked questions

'''Engine'''

:Documents concerning usage of Darkplaces engine

'''[[Decorator]]'''

:Information to work with Decorator - Blood Omnicide ingame editor

'''[[NetRadiant]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Tools]]'''

:Special Blood Omnicide tools</text>
    </revision>
    <revision>
      <id>11</id>
      <timestamp>2012-07-02T12:30:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Topics */</comment>
      <text xml:space="preserve" bytes="617">== Development Topics ==
'''[[General Editing]]'''

:Most common information and frequently asked questions

'''[[Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Decorator]]'''

:Information to work with Decorator - Blood Omnicide ingame editor

'''[[NetRadiant]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Tools]]'''

:Special Blood Omnicide tools</text>
    </revision>
    <revision>
      <id>12</id>
      <timestamp>2012-07-02T12:45:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1290">{| border=1 cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>13</id>
      <timestamp>2012-07-02T12:51:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1318">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>39</id>
      <timestamp>2012-07-02T14:42:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Topics */</comment>
      <text xml:space="preserve" bytes="1319">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

:'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>40</id>
      <timestamp>2012-07-02T14:43:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Topics */</comment>
      <text xml:space="preserve" bytes="1318">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>144</id>
      <timestamp>2012-07-02T19:28:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1420">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>145</id>
      <timestamp>2012-07-02T19:29:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1423">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

-

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>146</id>
      <timestamp>2012-07-02T19:29:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1425">Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

---

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>147</id>
      <timestamp>2012-07-02T19:29:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1427">Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

-----

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>148</id>
      <timestamp>2012-07-02T19:30:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1444">&lt;center&gt;Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.&lt;/center&gt;

-----

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>149</id>
      <timestamp>2012-07-02T19:30:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1466">&lt;center&gt;&lt;font size=&quot;4&quot;&gt;Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.&lt;/font&gt;&lt;/center&gt;

-----

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>150</id>
      <timestamp>2012-07-02T19:31:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1505">

&lt;center&gt;&lt;font size=&quot;6&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.&lt;/font&gt;&lt;/center&gt;


-----


{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>151</id>
      <timestamp>2012-07-02T19:31:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1505">

&lt;center&gt;&lt;font size=&quot;6&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki

so it contains alot of spoilers on storyline, secrets and cheats.&lt;/font&gt;&lt;/center&gt;


-----


{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>152</id>
      <timestamp>2012-07-02T19:32:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1573">

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki&lt;/font&gt;&lt;/center&gt;

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;It contains alot of spoilers on storyline and game secrets.&lt;/font&gt;&lt;/center&gt;


-----


{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>153</id>
      <timestamp>2012-07-02T19:32:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1593">

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki&lt;/font&gt;&lt;/center&gt;

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;It contains alot of spoilers on storyline and game secrets.&lt;/font&gt;&lt;/center&gt;


-----

&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>154</id>
      <timestamp>2012-07-02T19:33:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;


-----

&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>155</id>
      <timestamp>2012-07-02T19:33:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1439">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>156</id>
      <timestamp>2012-07-02T19:33:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1456">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

 | valign=top |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>157</id>
      <timestamp>2012-07-02T19:34:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1524">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top width=33% style=&quot;border-right: 1px solid #DDD&quot; |

 | valign=top width=33% style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top width=33% |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>158</id>
      <timestamp>2012-07-02T19:34:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1460">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top width=33% style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top width=33% |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>160</id>
      <timestamp>2012-07-02T19:41:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1460">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top width=15% style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top width=33% |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>161</id>
      <timestamp>2012-07-02T19:41:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1440">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>216</id>
      <timestamp>2012-07-03T06:18:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1498">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

== Blood Omnicide .Plan ==
'''[[Levels]]'''
:Level sheme

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>218</id>
      <timestamp>2012-07-03T06:21:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide .Plan */</comment>
      <text xml:space="preserve" bytes="1514">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

== Blood Omnicide .Plan ==
* '''[[Music themes]]'''
* '''[[All maps]]'''

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>219</id>
      <timestamp>2012-07-03T06:28:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide .Plan */</comment>
      <text xml:space="preserve" bytes="1566">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

== Blood Omnicide .Plan ==
* '''[[Blood Omnicide Music Themes | Music themes]]'''
* '''[[Blood Omnicide Maps | All maps]]'''

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>220</id>
      <timestamp>2012-07-03T06:29:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1440">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>224</id>
      <timestamp>2012-07-03T06:31:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1436">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>225</id>
      <timestamp>2012-07-03T06:31:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1419">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>226</id>
      <timestamp>2012-07-03T06:31:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1437">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>227</id>
      <timestamp>2012-07-03T06:31:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1438">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>228</id>
      <timestamp>2012-07-03T06:44:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1442">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

Game scripts editing

* [[Pattern script]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>229</id>
      <timestamp>2012-07-03T06:44:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1460">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

Game scripts editing

* [[Pattern scripts | Pattern script]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>230</id>
      <timestamp>2012-07-03T06:44:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1460">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

Game scripts editing

* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>231</id>
      <timestamp>2012-07-03T06:44:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1466">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''Game scripts editing'''

* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>233</id>
      <timestamp>2012-07-03T06:56:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1485">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>254</id>
      <timestamp>2012-07-03T07:51:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1504">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]



'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>255</id>
      <timestamp>2012-07-03T07:54:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1190">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine''
* [[Material system]]
* [[Virtual file system]]

'''Level editing'''

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>256</id>
      <timestamp>2012-07-03T07:55:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1191">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine''
* [[Material system]]
* [[Virtual file system]]

'''Level editing'''

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>257</id>
      <timestamp>2012-07-03T07:55:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1270">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>258</id>
      <timestamp>2012-07-03T07:56:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1295">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Tutorials]]

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>259</id>
      <timestamp>2012-07-03T07:58:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1421">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>260</id>
      <timestamp>2012-07-03T07:59:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1422">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>261</id>
      <timestamp>2012-07-03T07:59:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1422">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

===Darkplaces engine===
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>262</id>
      <timestamp>2012-07-03T07:59:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1422">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>263</id>
      <timestamp>2012-07-03T07:59:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1424">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine====
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>264</id>
      <timestamp>2012-07-03T08:00:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1442">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages===

* [[Translation packs reference]]

===Tools &amp; Stuff===

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>265</id>
      <timestamp>2012-07-03T08:01:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>266</id>
      <timestamp>2012-07-03T08:02:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1456">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>267</id>
      <timestamp>2012-07-03T08:03:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1433">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>268</id>
      <timestamp>2012-07-03T08:03:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1435">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>269</id>
      <timestamp>2012-07-03T08:03:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=40% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>270</id>
      <timestamp>2012-07-03T08:03:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1441">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=[[Blood Omnicide project]]=
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>271</id>
      <timestamp>2012-07-03T08:04:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1443">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



==[[Blood Omnicide project]]==
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>272</id>
      <timestamp>2012-07-03T08:04:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



===[[Blood Omnicide project]]===
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>273</id>
      <timestamp>2012-07-03T08:04:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



===[[Blood Omnicide project]]===
:Most common information and frequently asked questions

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>274</id>
      <timestamp>2012-07-03T08:07:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1529">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
 Features
 Blood Omnicide Codex
 Project: Bloody Sounds
 Project: Distinct Chronicles
:Most common information and frequently asked questions

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>275</id>
      <timestamp>2012-07-03T08:07:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1533">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
:Most common information and frequently asked questions
* Features
* Blood Omnicide Codex
* Project: Bloody Sounds
* Project: Distinct Chronicles

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>276</id>
      <timestamp>2012-07-03T08:07:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1549">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
:Most common information and frequently asked questions
* [[Features]]
* [[Blood Omnicide Codex]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>277</id>
      <timestamp>2012-07-03T08:08:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1527">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>278</id>
      <timestamp>2012-07-03T08:09:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1299">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

===[[Nosgoth]]===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>279</id>
      <timestamp>2012-07-03T08:09:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1297">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== Nosgoth ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>280</id>
      <timestamp>2012-07-03T08:09:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1286">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== Nosgoth ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>281</id>
      <timestamp>2012-07-03T08:10:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1317">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>282</id>
      <timestamp>2012-07-03T08:11:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="1317">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>283</id>
      <timestamp>2012-07-03T08:11:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine reference */</comment>
      <text xml:space="preserve" bytes="1317">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>284</id>
      <timestamp>2012-07-03T08:12:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing */</comment>
      <text xml:space="preserve" bytes="1350">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>285</id>
      <timestamp>2012-07-03T08:14:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2134">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;

Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>286</id>
      <timestamp>2012-07-03T08:14:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2116">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>287</id>
      <timestamp>2012-07-03T08:15:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;1&quot;?
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>288</id>
      <timestamp>2012-07-03T08:15:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;1&quot;&gt;
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>289</id>
      <timestamp>2012-07-03T08:15:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;4&quot;&gt;
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>290</id>
      <timestamp>2012-07-03T08:15:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;3&quot;&gt;
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>291</id>
      <timestamp>2012-07-03T08:15:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2140">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;3&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>292</id>
      <timestamp>2012-07-03T08:15:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2140">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;5&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;3&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>293</id>
      <timestamp>2012-07-03T08:16:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2086">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;3&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>294</id>
      <timestamp>2012-07-03T08:16:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2086">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>295</id>
      <timestamp>2012-07-03T08:34:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2102">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>298</id>
      <timestamp>2012-07-03T13:02:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Translating Blood Omnicide to other languages */</comment>
      <text xml:space="preserve" bytes="2116">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>367</id>
      <timestamp>2012-07-10T18:29:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2119">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>368</id>
      <timestamp>2012-07-10T18:29:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2136">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>369</id>
      <timestamp>2012-07-10T18:30:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2133">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>372</id>
      <timestamp>2012-07-10T18:37:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2136">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>718</id>
      <timestamp>2012-07-15T02:20:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2148">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>721</id>
      <timestamp>2012-07-16T06:19:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2179">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===

* [[BloodWiki:Community_portal | Community portal]]

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>722</id>
      <timestamp>2012-07-16T06:20:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2195">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===

* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>723</id>
      <timestamp>2012-07-16T06:22:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2191">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion reference]]
* [[Translation | Translation packs reference]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>804</id>
      <timestamp>2012-07-16T09:08:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2181">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion reference]]
* [[Translation | Translation packs]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>805</id>
      <timestamp>2012-07-16T09:08:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2178">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>806</id>
      <timestamp>2012-07-16T09:09:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1730">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development of Blood Omnicide.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>807</id>
      <timestamp>2012-07-16T11:41:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1755">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development of Blood Omnicide.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>808</id>
      <timestamp>2012-07-16T11:42:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General reference */</comment>
      <text xml:space="preserve" bytes="1766">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development of Blood Omnicide.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>839</id>
      <timestamp>2012-07-16T16:48:20Z</timestamp>
      <contributor>
        <ip>89.179.235.231</ip>
      </contributor>
      <text xml:space="preserve" bytes="1837">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>848</id>
      <timestamp>2012-07-16T17:11:57Z</timestamp>
      <contributor>
        <username>Amddred</username>
        <id>2</id>
      </contributor>
      <minor/>
      <comment>/* World of Blood Omen */ Adding more options</comment>
      <text xml:space="preserve" bytes="1887">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>883</id>
      <timestamp>2012-07-16T19:29:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1933">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

{{article unfinished}}

==== Level editing reference ====
[[Radiant Glossary]]

* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>884</id>
      <timestamp>2012-07-16T19:29:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1926">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

{{article unfinished}}

==== Level editing reference ====
* [[Glossary]]
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>885</id>
      <timestamp>2012-07-16T19:30:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1945">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

{{article unfinished}}

==== Level editing reference ====
* [[Radiant Glossary | Glossary]]
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>889</id>
      <timestamp>2012-07-16T19:34:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1921">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant Glossary | Glossary]]
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>890</id>
      <timestamp>2012-07-16T19:37:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1912">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant Glossary | Glossary]]
* [[Working with brushes]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>891</id>
      <timestamp>2012-07-16T19:39:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1904">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Introduction]]
* [[Radiant/Glossary | Glossary]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>893</id>
      <timestamp>2012-07-16T19:40:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1886">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction Introduction]]
* [[Radiant/Glossary | Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>894</id>
      <timestamp>2012-07-16T19:40:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1888">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant/Glossary | Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>898</id>
      <timestamp>2012-07-16T19:49:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1896">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant/Glossary | Radiant Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>900</id>
      <timestamp>2012-07-16T19:51:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1896">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant Glossary | Radiant Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>902</id>
      <timestamp>2012-07-16T19:52:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1896">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant Glossary | Radiant glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>903</id>
      <timestamp>2012-07-16T19:52:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1906">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[General reference | Radiant general reference]]
* [[Radiant Glossary | Radiant glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>905</id>
      <timestamp>2012-07-16T19:53:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1864">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>907</id>
      <timestamp>2012-07-16T19:56:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Tools &amp; Stuff */</comment>
      <text xml:space="preserve" bytes="1865">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>953</id>
      <timestamp>2012-07-16T20:58:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1865">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>988</id>
      <timestamp>2012-07-17T05:14:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1909">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1019</id>
      <timestamp>2012-07-17T08:10:57Z</timestamp>
      <contributor>
        <username>Amddred</username>
        <id>2</id>
      </contributor>
      <minor/>
      <comment>/* World of Blood Omen */ Remove Kain</comment>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1221</id>
      <timestamp>2012-07-18T09:57:44Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="1892">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__

1</text>
    </revision>
    <revision>
      <id>1222</id>
      <timestamp>2012-07-18T09:57:51Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1223</id>
      <timestamp>2012-07-18T10:02:34Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1224</id>
      <timestamp>2012-07-18T10:02:40Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1225</id>
      <timestamp>2012-07-18T10:04:30Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1226</id>
      <timestamp>2012-07-18T10:04:36Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1227</id>
      <timestamp>2012-07-18T10:10:26Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1228</id>
      <timestamp>2012-07-18T10:10:31Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1229</id>
      <timestamp>2012-07-18T10:15:02Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1230</id>
      <timestamp>2012-07-18T10:15:10Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1231</id>
      <timestamp>2012-07-18T10:19:20Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1232</id>
      <timestamp>2012-07-18T10:19:32Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1233</id>
      <timestamp>2012-07-18T10:19:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1234</id>
      <timestamp>2012-07-18T10:19:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1320</id>
      <timestamp>2012-07-20T10:50:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2003">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces Material system | Material system]]
* [[Material system | Old Material system article]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1324</id>
      <timestamp>2012-07-20T10:52:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2003">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Material system | Old Material system article]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1325</id>
      <timestamp>2012-07-20T10:52:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="1997">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Material system | Material system (old)]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1328</id>
      <timestamp>2012-07-20T10:59:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2058">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Material system | Material system (old)]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1706</id>
      <timestamp>2012-07-23T10:12:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2012">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1780</id>
      <timestamp>2012-07-26T05:55:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1929">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1781</id>
      <timestamp>2012-07-26T10:36:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1713">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1925</id>
      <timestamp>2012-07-27T09:58:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1713">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1958</id>
      <timestamp>2012-07-27T11:11:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1750">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces lighting | Lighting]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1961</id>
      <timestamp>2012-07-27T12:21:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1796">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces lighting | Lighting]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1962</id>
      <timestamp>2012-07-27T12:22:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="1796">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1983</id>
      <timestamp>2012-07-27T13:14:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1924">{{DISPLAYTITLE:Blood Omnicide Wiki}}
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1984</id>
      <timestamp>2012-07-27T13:16:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1911">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1987</id>
      <timestamp>2012-07-27T13:19:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1910">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2191</id>
      <timestamp>2012-07-29T22:42:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1955">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:Recent_pages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2202</id>
      <timestamp>2012-07-30T05:40:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1968">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:Recent_pages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2231</id>
      <timestamp>2012-07-30T19:48:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1967">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2342</id>
      <timestamp>2012-08-01T09:24:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="1968">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2355</id>
      <timestamp>2012-08-01T10:05:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1948">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2359</id>
      <timestamp>2012-08-01T10:52:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1966">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2365</id>
      <timestamp>2012-08-01T12:48:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1969">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2405</id>
      <timestamp>2012-08-03T06:48:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1964">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2528</id>
      <timestamp>2012-08-09T12:54:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1989">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2544</id>
      <timestamp>2012-08-09T14:23:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2012">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2691</id>
      <timestamp>2012-09-25T21:10:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2012">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2794</id>
      <timestamp>2012-10-16T15:12:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2020">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2806</id>
      <timestamp>2012-11-21T20:23:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2024">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2814</id>
      <timestamp>2012-11-22T05:04:15Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="2025">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2845</id>
      <timestamp>2012-11-22T11:01:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2055">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2850</id>
      <timestamp>2012-11-22T11:34:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2038">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2868</id>
      <timestamp>2012-11-22T12:41:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2146">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in russian]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2869</id>
      <timestamp>2012-11-22T12:42:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2146">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2911</id>
      <timestamp>2012-11-23T03:15:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2087">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
* [[ChangeLog:Blood Omnicide|SVN change log]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[Game world reference]]
* [[Blood Omen file formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2931</id>
      <timestamp>2012-11-28T17:18:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2261">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[Game world reference]]
* [[Blood Omen file formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2932</id>
      <timestamp>2012-11-28T17:19:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2245">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Game world reference]]
* [[Blood Omen file formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2946</id>
      <timestamp>2012-11-29T20:51:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2306">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[Blood Omen/Characters|Characters]]
* [[Blood Omen/File formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3120</id>
      <timestamp>2012-11-30T10:12:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2316">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen File formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3122</id>
      <timestamp>2012-11-30T10:12:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2316">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3274</id>
      <timestamp>2012-11-30T11:16:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2358">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3286</id>
      <timestamp>2012-12-01T23:57:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2374">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;padding-top:0px&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3287</id>
      <timestamp>2012-12-01T23:57:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2377">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3289</id>
      <timestamp>2012-12-02T02:10:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2335">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3291</id>
      <timestamp>2012-12-03T21:52:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2358">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3348</id>
      <timestamp>2013-01-15T13:29:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2405">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3433</id>
      <timestamp>2013-01-22T16:40:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2235">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
Currently SVN changelog is not available
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3472</id>
      <timestamp>2013-01-22T19:15:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2249">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
Currently SVN changelog is not available
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}
{{Languages}}</text>
    </revision>
    <revision>
      <id>3473</id>
      <timestamp>2013-01-22T19:15:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2235">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
Currently SVN changelog is not available
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3579</id>
      <timestamp>2013-01-31T19:45:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2405">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3612</id>
      <timestamp>2013-02-24T08:22:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>fixed SVN log to show up again</comment>
      <text xml:space="preserve" bytes="2453">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3634</id>
      <timestamp>2013-04-09T18:05:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2609">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
'''Sorry. Currently we experiencing problems with SVN RSS feed.'''

'''You can find the actual SVN log [http://www.svn2rss.ru/svn.show.php?id=25 here]'''


&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3645</id>
      <timestamp>2013-04-18T15:49:38Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2613">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
'''Sorry. Currently we are experiencing problems with SVN RSS feed.'''

'''You can find the actual SVN log [http://www.svn2rss.ru/svn.show.php?id=25 here]'''


&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3647</id>
      <timestamp>2013-06-05T20:03:24Z</timestamp>
      <contributor>
        <ip>176.15.29.31</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2453">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3661</id>
      <timestamp>2013-09-01T11:19:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2293">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3671</id>
      <timestamp>2013-10-02T06:03:08Z</timestamp>
      <contributor>
        <ip>185.10.129.248</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2339">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[DpEditor Reference | DpEditor Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3677</id>
      <timestamp>2013-10-02T11:37:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2343">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[OmniEditor reference | OmniEditor reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>3dsMax ASE Importer</title>
    <ns>0</ns>
    <id>282</id>
      <sha1>0e80nl5kozm7burzjrbj0irpxqzdayk</sha1>
    <revision>
      <id>2812</id>
      <timestamp>2012-11-21T20:48:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{finished}} {{grammar}} [[File:3dsmaxaseimporter.png|thumb|300px|right|importer main window]] 3ds Max ASE import plugin was originally created by Christer Janson at Kinetix D...&quot;</comment>
      <text xml:space="preserve" bytes="1528">{{finished}}
{{grammar}}
[[File:3dsmaxaseimporter.png|thumb|300px|right|importer main window]]
3ds Max ASE import plugin was originally created by Christer Janson at Kinetix Development as part of 3D Studio Max SDK.

With several fixups and tweaks it can be compiled into a working ASE Import plugin.

Can import:
* Triangle, normal and UV data
* Object positions, rotation, pivot
* Position/rotation/scale controllers (animation)
* Material list
* Vertex colors
* Lights
* Cameras
* Shapes
* Helpers

Fixes by Pavel [VorteX] Timofeyev:
* Several code cleanups to make it work with Max 2012
* Can import Quake 3 material names by detecting &quot;textures/&quot;, &quot;models/&quot;, &quot;particles/&quot;, &quot;gfx/&quot; (base path should be supplied)
* Fixed smoothing groups and U/V import

Bugs:
* Edges sometimes are not imported correctly
* Vertex morph animation is not supported

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max7.zip ASE Importer 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max2012_x86.zip ASE Importer 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max2012_x64.zip ASE Importer 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_src.zip ASE Importer 1.0 sourcecode]

==See also==
* [[Darkplaces MD3 Exporter|Darkplaces MD3 Exporter]]
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3668</id>
      <timestamp>2013-09-19T22:31:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Downloads */</comment>
      <text xml:space="preserve" bytes="1748">{{finished}}
{{grammar}}
[[File:3dsmaxaseimporter.png|thumb|300px|right|importer main window]]
3ds Max ASE import plugin was originally created by Christer Janson at Kinetix Development as part of 3D Studio Max SDK.

With several fixups and tweaks it can be compiled into a working ASE Import plugin.

Can import:
* Triangle, normal and UV data
* Object positions, rotation, pivot
* Position/rotation/scale controllers (animation)
* Material list
* Vertex colors
* Lights
* Cameras
* Shapes
* Helpers

Fixes by Pavel [VorteX] Timofeyev:
* Several code cleanups to make it work with Max 2012
* Can import Quake 3 material names by detecting &quot;textures/&quot;, &quot;models/&quot;, &quot;particles/&quot;, &quot;gfx/&quot; (base path should be supplied)
* Fixed smoothing groups and U/V import

Bugs:
* Edges sometimes are not imported correctly
* Vertex morph animation is not supported

==Downloads==
* [https://github.com/paulvortex/MaxAseImporter GitHub repository]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max7.zip ASE Importer 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max2011_x86.zip ASE Importer 1.0 for Max 2011 x86 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max2011_x64.zip ASE Importer 1.0 for Max 2011 x64 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max2012_x86.zip ASE Importer 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/aseimporter_1.00_max2012_x64.zip ASE Importer 1.0 for Max 2012 x64]

==See also==
* [[Darkplaces MD3 Exporter|Darkplaces MD3 Exporter]]
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>BIH</title>
    <ns>0</ns>
    <id>125</id>
      <sha1>i01ukye1e5ijfslahfs4gtrckr32vq9</sha1>
    <revision>
      <id>1364</id>
      <timestamp>2012-07-22T16:17:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;BIH stands for Bounding Interval Hierarchy. It is a partitioning data structure similar to [[BSP]] (Binary Space Partitioning) used by Quake1-3 games.   Some general attribute...&quot;</comment>
      <text xml:space="preserve" bytes="778">BIH stands for Bounding Interval Hierarchy. It is a partitioning data structure similar to [[BSP]] (Binary Space Partitioning) used by Quake1-3 games. 

Some general attributes:
* Very fast construction times
* Low memory footprint
* Simple and fast traversal
* Very simple construction and traversal algorithms
* High numerical precision during construction and traversal
* Flatter tree structure (decreased tree depth) compared to kd-trees

In Darkplaces, BIH is overlay implementation. Being activated, it replaces default BSP implementation in collision code. BIH is faster than BSP, requires less memory, and much more stable at arbitrary triangle meshes.

== Console variables ==

mod_collision_bih : enables use of BIH. Always on in Blood Omnicide.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1365</id>
      <timestamp>2012-07-22T16:17:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="809">BIH stands for Bounding Interval Hierarchy. It is a partitioning data structure similar to [[BSP]] (Binary Space Partitioning) used by Quake1-3 games. 

Some general attributes:
* Very fast construction times
* Low memory footprint
* Simple and fast traversal
* Very simple construction and traversal algorithms
* High numerical precision during construction and traversal
* Flatter tree structure (decreased tree depth) compared to kd-trees

In Darkplaces, BIH is overlay implementation. Being activated, it replaces default BSP implementation in collision code. BIH is faster than BSP, requires less memory, and much more stable at arbitrary triangle meshes.

== Console variables ==

mod_collision_bih : enables use of BIH. Always on in Blood Omnicide.

[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1368</id>
      <timestamp>2012-07-22T16:19:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="855">BIH ([http://en.wikipedia.org/wiki/Bounding_interval_hierarchy Bounding Interval Hierarchy]) is a partitioning data structure similar to [[BSP]] (Binary Space Partitioning) used by Quake1-3 games. 

Some general attributes:
* Very fast construction times
* Low memory footprint
* Simple and fast traversal
* Very simple construction and traversal algorithms
* High numerical precision during construction and traversal
* Flatter tree structure (decreased tree depth) compared to kd-trees

In Darkplaces, BIH is overlay implementation. Being activated, it replaces default BSP implementation in collision code. BIH is faster than BSP, requires less memory, and much more stable at arbitrary triangle meshes.

== Console variables ==

mod_collision_bih : enables use of BIH. Always on in Blood Omnicide.

[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2291</id>
      <timestamp>2012-07-30T21:46:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="872">BIH ([http://en.wikipedia.org/wiki/Bounding_interval_hierarchy Bounding Interval Hierarchy]) is a partitioning data structure similar to [[BSP]] (Binary Space Partitioning) used by Quake1-3 games. 

Some general attributes:
* Very fast construction times
* Low memory footprint
* Simple and fast traversal
* Very simple construction and traversal algorithms
* High numerical precision during construction and traversal
* Flatter tree structure (decreased tree depth) compared to kd-trees

In Darkplaces, BIH is overlay implementation. Being activated, it replaces default BSP implementation in collision code. BIH is faster than BSP, requires less memory, and much more stable at arbitrary triangle meshes.

==Console variables==
{{cvar|mod_collision_bih|enables use of BIH. Always on in Blood Omnicide.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3603</id>
      <timestamp>2013-02-20T18:46:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="849">BIH ([http://en.wikipedia.org/wiki/Bounding_interval_hierarchy Bounding Interval Hierarchy]) is a partitioning data structure similar to [[BSP]] (Binary Space Partitioning). 

Some general attributes:
* Very fast construction times
* Low memory footprint
* Simple and fast traversal
* Very simple construction and traversal algorithms
* High numerical precision during construction and traversal
* Flatter tree structure (decreased tree depth) compared to kd-trees

In Darkplaces, BIH is overlay implementation. Being activated, it replaces default BSP implementation in collision code. BIH is faster than BSP, requires less memory, and much more stable at arbitrary triangle meshes.

==Console variables==
{{cvar|mod_collision_bih|enables use of BIH. Always on in Blood Omnicide.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>BModel</title>
    <ns>0</ns>
    <id>25</id>
      <sha1>bopntl6pd7e06qcetrzrjx92apdpr5y</sha1>
    <revision>
      <id>312</id>
      <timestamp>2012-07-03T22:07:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;BModel (bsp model) or submodel is a model constructed in level editor out of brushes or patches. Doors, trains, platforms are bmodels.  == Benefits ==  * very fast to render *...&quot;</comment>
      <text xml:space="preserve" bytes="616">BModel (bsp model) or submodel is a model constructed in level editor out of brushes or patches. Doors, trains, platforms are bmodels.

== Benefits ==

* very fast to render
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* supplied with level BSP file (also can make external bmodel which will have .BSP extension)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* complex models have very rough triangle mesh
* only simple models is easy to make

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>429</id>
      <timestamp>2012-07-14T19:47:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="596">BModel (bsp model) or submodel is a model constructed in level editor out of brushes or patches. Doors, trains, platforms are bmodels.

== Benefits ==

* very fast to render
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* supplied with level BSP file (also can make external bmodel which will have .BSP extension)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* complex models have very rough triangle mesh
* only simple models is easy to make

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>809</id>
      <timestamp>2012-07-16T11:48:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="965">BModel (bsp model) or submodel, mapobject model is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from [[CSG]])
* complex models with lots of corners or curved surfaces is not that easy to make

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>810</id>
      <timestamp>2012-07-16T11:49:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Drawbacks */</comment>
      <text xml:space="preserve" bytes="973">BModel (bsp model) or submodel, mapobject model is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from [[brush | CSG]])
* complex models with lots of corners or curved surfaces is not that easy to make

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>811</id>
      <timestamp>2012-07-16T11:49:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="965">BModel (bsp model) or submodel, mapobject model is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>821</id>
      <timestamp>2012-07-16T12:26:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="963">BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>826</id>
      <timestamp>2012-07-16T12:27:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Bmodel]] to [[BModel]]</comment>
      <text xml:space="preserve" bytes="963">BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>887</id>
      <timestamp>2012-07-16T19:32:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1014">BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Q3BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>888</id>
      <timestamp>2012-07-16T19:32:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* See also */</comment>
      <text xml:space="preserve" bytes="1014">BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[pathch | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Radiant Glossary]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1907</id>
      <timestamp>2012-07-27T09:23:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1018">BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[patch mesh | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Radiant Glossary]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2308</id>
      <timestamp>2012-07-30T21:56:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1053">{{unfinished}}
{{need screenshot}}
BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[patch mesh | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Radiant Glossary]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2309</id>
      <timestamp>2012-07-30T21:56:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1033">{{unfinished}}
BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[patch mesh | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Radiant Glossary]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2761</id>
      <timestamp>2012-10-10T10:21:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1050">{{unfinished}}
BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[patch mesh | patches]] and compiled into the .bsp file. Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2779</id>
      <timestamp>2012-10-10T12:01:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1131">{{unfinished}}
BModel (bsp model, submodel, mapobject model) is a model constructed in level editor out of [[brush | brushes]] or [[patch mesh | patches]] and compiled into the .bsp file. Brush model can have triangle models attached (they become a part of the model). Doors, trains, platforms are bmodels. 

BModel could be internal (supplied with the level and have special names such as *1, *2, *3 etc.) and external (BSP files). External BSP model differs from level file, it usually have no VIS data, entities, and other level-specific data.

== Benefits ==

* very fast to render
* automatically get collisions
* supplied with level .bsp's (no external files)
* easy to construct in level editor (dont need a third party tools)
* can be lightmapped or lit dynamically (using lightgrid)
* can have triangle models attached

== Drawbacks ==

* cannot be animated (only moved/rotated)
* badly optimized mesh (since it automatically generated from brushes)
* complex models with lots of corners or curved surfaces is not that easy to make

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>BSP</title>
    <ns>0</ns>
    <id>81</id>
      <sha1>8ttwr18k1wopcpvrxi5mhlfy5tmi7yd</sha1>
    <revision>
      <id>822</id>
      <timestamp>2012-07-16T12:26:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.  It is also extension of level files for Id Tech 2-3 games and Darkplaces.  B...&quot;</comment>
      <text xml:space="preserve" bytes="307">BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lightning, game objects etc.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>823</id>
      <timestamp>2012-07-16T12:26:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="314">BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lightning, game objects etc.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>824</id>
      <timestamp>2012-07-16T12:27:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="355">BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lightning, game objects etc.

== See also ==
* [[BModel]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>825</id>
      <timestamp>2012-07-16T12:27:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="355">BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lightning, game objects etc.

== See also ==
* [[Bmodel]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>828</id>
      <timestamp>2012-07-16T12:28:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="355">BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lightning, game objects etc.

== See also ==
* [[BModel]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>829</id>
      <timestamp>2012-07-16T12:30:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="354">BSP (Binary Space Partitioning) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lighting, game objects etc.

== See also ==
* [[BModel]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1366</id>
      <timestamp>2012-07-22T16:18:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="411">BSP ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lighting, game objects etc.

== See also ==
* [[BModel]]
* [[Q3BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1367</id>
      <timestamp>2012-07-22T16:18:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="421">BSP ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.

It is also extension of level files for Id Tech 2-3 games and Darkplaces engine.

BSP file stores level-specific data, such as level geometry, lightmaps, volumeric lighting, game objects etc.

== See also ==
* [[BModel]]
* [[Q3BSP]]
* [[BIH]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1385</id>
      <timestamp>2012-07-22T17:25:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="344">BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.
* extension of [[BSP (file) | level files] for Quake engine and all of it's successors.
* first stage of map compilation (see [[BSP (file) | BSP file]])

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1386</id>
      <timestamp>2012-07-22T17:25:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="345">BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.
* extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* first stage of map compilation (see [[BSP (file) | BSP file]])

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1387</id>
      <timestamp>2012-07-22T17:26:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="333">BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.
* extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* first stage of level files compilation (see above)

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2305</id>
      <timestamp>2012-07-30T21:55:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="346">BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.
* extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* first stage of level files compilation (see above)

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2393</id>
      <timestamp>2012-08-03T06:19:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="358">{{grammar}}
BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.
* extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* first stage of level files compilation (see above)

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2404</id>
      <timestamp>2012-08-03T06:47:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="389">{{grammar}}
BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) is technique used in games for rendering and collision detection.
* extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* first stage of level files compilation (see above)

[[Category:Darkplaces engine]]
[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2708</id>
      <timestamp>2012-09-28T13:37:48Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="407">{{grammar checked|darth}}
BSP refers to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) ‒ a technique used in games for rendering and collision detection.
* Extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* First stage of level files compilation (see above).

[[Category:Darkplaces engine]]
[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2709</id>
      <timestamp>2012-09-28T13:39:44Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="410">{{grammar checked|darth}}
BSP may refer to:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Binary Space Partitioning]) ‒ a technique used in games for rendering and collision detection.
* Extension of [[BSP (file) | level files]] for Quake engine and all of it's successors.
* First stage of level files compilation (see above).

[[Category:Darkplaces engine]]
[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>BSP (file)</title>
    <ns>0</ns>
    <id>126</id>
      <sha1>26e9vswntkqdafmbl5fg16pia4ajfjh</sha1>
    <revision>
      <id>1380</id>
      <timestamp>2012-07-22T17:20:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).  BSP is not suited for direct ...&quot;</comment>
      <text xml:space="preserve" bytes="818">File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated for a map.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each of game and engine, BSP file version and structure is different. Blood Omnicide using Id Tech 3 BSP version, known as [[Q3BSP]].

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* Quake 3 BSP

[[Category:Glossary]]
[[Category:Darkplaces engine]]]</text>
    </revision>
    <revision>
      <id>1381</id>
      <timestamp>2012-07-22T17:21:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="812">File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated for a map.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each game engine, BSP file version and structure is different.

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide is using Quake 3 BSP for all levels.

[[Category:Glossary]]
[[Category:Darkplaces engine]]]</text>
    </revision>
    <revision>
      <id>1382</id>
      <timestamp>2012-07-22T17:22:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="802">File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each game engine, BSP file version and structure is different.

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide is using Quake 3 BSP for all levels.

[[Category:Glossary]]
[[Category:Darkplaces engine]]]</text>
    </revision>
    <revision>
      <id>1383</id>
      <timestamp>2012-07-22T17:23:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="801">File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each game engine, BSP file version and structure is different.

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide is using Quake 3 BSP for all levels.

[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1384</id>
      <timestamp>2012-07-22T17:24:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="852">File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each game engine, BSP file version and structure is different.

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide is using Quake 3 BSP for all levels.

== See also ==
* [[BModel]]
* [[Q3BSP]]
* [[BIH]]

[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1388</id>
      <timestamp>2012-07-22T17:26:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="888">File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each game engine, BSP file version and structure is different.

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide is using Quake 3 BSP for all levels.

== See also ==
* [[MAP]]
* [[BModel]]
* [[Q3BSP]]
* [[BIH]]

[[Category:Glossary]]
[[Category:File formats]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2280</id>
      <timestamp>2012-07-30T20:43:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="903">{{unfinished}}
File storing level geometry and objects for Quake engine and all of it's successors (Id tech 2, Id Tech 3, Goldsrc engine, Source engine, etc.).

BSP is not suited for direct editing. It get builded from a [[MAP]] file. The process of building is called compilation. Compilation have several stages:

* BSP - first stage, map geometry is converted to BSP tree, all level structures are created.
* VIS - cluster-to-cluster visibility being calculated.
* LIGHT - static lighting (lightmap, lightgrid) being generated.

For each game engine, BSP file version and structure is different.

Darkplaces engine can load following BSP file versions:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide is using Quake 3 BSP for all levels.

== See also ==
* [[MAP]]
* [[BModel]]
* [[Q3BSP]]
* [[BIH]]

[[Category:Glossary]]
[[Category:File formats]]
[[Category:Darkplaces engine]]</text>
    </revision>
  </page>
  <page>
    <title>Blood Omen file formats</title>
    <ns>0</ns>
    <id>304</id>
      <sha1>pz3d0fjs6qv92kadiyn1y4yjz0mf4q7</sha1>
    <revision>
      <id>2837</id>
      <timestamp>2012-11-22T08:41:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released.   Most basic f...&quot;</comment>
      <text xml:space="preserve" bytes="19602">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's 4bit Very-Audio-Good files (ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. In PC versino they are unused. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collection.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    byte - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]])).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''variable bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same 

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

// blood omen map structure
typedef struct 
{
	unsigned short parm1;    // first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value
	                         //  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)
	                         //  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)
	unsigned short parm2;    // second parm:
	                         //  - button num (TRIGGER_BUTTON)
	                         //  - pic num (TRIGGER_IMAGEMARK)
	byte           parm3;    // destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)
	byte           srcx;     // sposition
	byte           srcy;     // sposition
	byte           type;     // script type, one of TRIGGER_
	byte           u2[3];    // ?
	byte           x;        // position
	byte           y;        // position
	byte           u3[3];    // ?
}bo_trigger_t;

typedef struct
{
	unsigned short savenum;  // unique savegame id
	byte           itemcode; // one of MAPITEM_ code
	byte           x;        // position
	byte           y;        // position
	byte           hidden;   // set to 1 if item is spawned by trigger (like barrel destruction)
	unsigned short target;   // targeted triggergroup
	byte           u[4];     // ?
}bo_item_t;

typedef struct
{
    unsigned short targetnum;// a triggergroup
	byte x;                  // position
	byte u1;                 // ?
	byte y;                  // position
	byte u2;                 // ?
	unsigned short tile1;    // tilenum
	unsigned short tile2;    // alternate state tilenum
	byte contents1;          // contents, see CONTENTS_ defines for possible content values
	byte contents2;          // alternate state contents
	byte u3[12];             // ?
}bo_atile_t;

typedef struct
{
	unsigned short target;   // a triggergroup to call
	unsigned short tile1;    // tilenum
	unsigned short tile2;    // alternate state tilenum
	byte flags;              // see BUTTONFLAG_* defs
	byte u1;                 // ?
	unsigned short savenum;  // unique savegame id
	byte u2;                 // ?
	byte u3;                 // ?
}bo_button_t;

typedef struct
{
	byte x;                  // position
	byte y;                  // position
	byte lightposx;          // position of lightsource
	byte lightposy;          // position of lightsource
	byte sprite;             // index of sprite from sprites array
	byte lightsizex;         // size of light polygons
	byte lightsizey;         // size of light polygons
	byte u1;                 // ?
	byte lightform;          // light form flags
	byte r;                  // red color component
	byte g;                  // green color component
	byte b;                  // blue color component
	unsigned short targetnum;// triggergroup
	byte start_on;           // 1 if effect starts on, 0 if starts off
	byte u3[5];              // ?
}bo_effect_t;

typedef struct
{
	byte data[164];
}bo_object_t;

typedef struct
{
	byte x;                  // start position
	byte y;                  // end position
	byte w;                  // width
	byte h;                  // height
	byte ofsx;               // multiply by 16 to get real offset
	byte ofsy;               // multiply by 16 to get real offset
	byte u1;
	byte u2;
}bo_grpobject_t;

typedef struct
{
	byte u1;                 // ?
	byte u2;                 // ?
	byte u3;                 // ?
	byte u4;                 // ?
	unsigned short tile1;    // base tile (grpobject really, not standart 32x32 tile)
	unsigned short tile2;    // toggled tile (grpobject)
	unsigned short tile3;    // destroyed tilee (grpobject)
	byte u5;                 // ?
	byte u6;                 // ?
	byte pushable;           // a strength required to push
	byte toggled;            // trigger can toggle it's state (means tile2 is there)
	byte u7;                 // ?
	byte spawnitems[3];      // item codes to spawn when toggled/destroyed
	byte u8;                 // ?
	byte destructible;       // destructible flags
	unsigned short savenum;  // unique savegame id
	byte u10;                // ?
	byte x;                  // position
	byte y;                  // position
	byte u11;                // ? 
	byte active;             // 1 is filled, otherwise 0
	byte u13;                // ? 
}bo_scenery_t;

typedef struct
{
	byte x;                  // position
	byte y;                  // position
	byte u1;                 // ?
	byte u2;                 // ?
}bo_path_t;

typedef struct
{
	bo_path_t paths[4];      // patrole paths
	byte u1[12];             // ?
	unsigned short savenum;  // unique savegame id
	byte u2[52];             // ?
	byte charnum;            // monster class (same as char* sprite)
	byte u3[10];             // ?
	unsigned short target;   // triggergroup to call once killed
	byte u4[20];             // ?
	byte lastpath;           // ?
	byte u6[18];             // ?
	byte u7[15];             // ?
	byte x;                  // position
	byte y;                  // position
	byte u8[4];              // ?
	unsigned short speechnum;// a speech number for disguise talk
	byte u9[6];              // ?
}bo_monster_t;

typedef struct
{
	// a chain of tilemap numbers used (to make a filenames)
	// each tilemap holds 64 tiles, tiles numbering is linear
	// like, a tile #131 is tile #3 from tilemap #2
	// being 2-byte (unsigned short) tilenum contains some flags (flag are starting from byte 10)
	// see TILEFLAG_ defines for possible tileflags
	unsigned short  tilemaps[40];
	// yet unknown info
	byte            u1[12];
	bo_object_t     objects[10];
	bo_monster_t    monsters[32];
	bo_grpobject_t  grpobjects[8][32];
	// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state
	// used on doors, spikes that pops up on the floor etc.
	// animated tiles have triggergroup to be executed by script
	bo_atile_t      atiles[100];
	// a special buttons array holds all buttons used on level
	// pretty similar to animated tiles
	// buttons have triggergroup to be executed by script
	bo_button_t     buttons[20];
	// yet unknown info #2
	byte            u2[8];
	// scenery pushable objects - tables, chairs, stones etc.
	bo_scenery_t    scenery[256];
	// first tilemap
	unsigned short  backtiles[80][80];
	// second tilemap
	unsigned short  foretiles[80][80];
	// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)
	// see CONTENTS_ defines for possible content values
	byte            contents[80][80];
	// linear triggers array - all triggers used on map
	bo_trigger_t    triggers[255];
	// triggers are non-solid interaction points, activated when player stands in them
	// this array golds pointers to triggers
	byte            triggertiles[80][80];
	// items placed on level
	// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes
	// so there will be not more than 4 unique item type per level
	// unique items are: spells, weapons, forms, artifacts, tokens
	byte            uniqueitems[4];
	bo_item_t      	items[50];
	// yet unknown data
	byte            u4[8];
	byte            u5[8][40];
	byte            u6[24];
	// effects
	unsigned short  sprites[8];
	bo_effect_t     effects[64];
	// yet unknown data
	unsigned char   u7[936];
}bo_map_t;

// things that are not figured out yet:
// - how lightning is done (variable form lights, day-night light, ambient light)
// - monster's paths's switch (some paths are messed up)
// - counters and puzzle triggers?

// tileflags
#define TILEFLAG_UNKNOWN1       1024
#define TILEFLAG_NODRAW         2048
#define TILEFLAG_UNKNOWN3       4096
#define TILEFLAG_UNKNOWN4       8192
#define TILEFLAG_ALWAYSONTOP    16384
#define TILEFLAG_UNKNOWN6       32768
#define TILEFLAG_MASK           (1024 + 2048 + 4096 + 8192 + 16384 + 32768)
#define TILEFLAG_IMASK          (1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512)

// contents
#define CONTENTS_SOLID          1
#define CONTENTS_WATER          2
#define CONTENTS_LAVA           3
#define CONTENTS_FIRE           4
#define CONTENTS_SPIKES         5
#define CONTENTS_TRAPTELEPORT   6
#define CONTENTS_JUMPWALL       8
#define CONTENTS_SWAMP          11
#define CONTENTS_JUMPFENCE      10
#define CONTENTS_MISTWALK       12
#define CONTENTS_SACRIFICE      13
#define CONTENTS_ICE            19
#define CONTENTS_SAVEGAME       44
#define CONTENTS_BATMARK        45

// triggers
#define TRIGGER_EXIT            1
#define TRIGGER_ENTRANCE        2
#define TRIGGER_SPEECHMARK      3
#define TRIGGER_TOUCH           4
#define TRIGGER_TELEPORT        6
#define TRIGGER_IMAGEMARK       7

// button flags
#define BUTTONFLAG_TOGGLE		1
#define BUTTONFLAG_SECRET       2

// item codes
#define MAPITEM_SMALLBLOODFLASK 1
#define MAPITEM_BLOODFLASK      2
#define MAPITEM_RUNEPYRAMID     3
#define MAPITEM_PURPLESPHERE    4
#define MAPITEM_BLUESPHERE      5
#define MAPITEM_GREENSPHERE     6
#define MAPITEM_GOLDSPHERE      7
#define MAPITEM_REDSPHERE       8
#define MAPITEM_ANCIENTVIAL     9
#define MAPITEM_UNIQUE1         10 // unique item codes
#define MAPITEM_UNIQUE2         11 // unique item codes
#define MAPITEM_UNIQUE3         12 // unique item codes
#define MAPITEM_UNIQUE4         13 // unique item codes

// real item codes
#define ITEM_SPELL_INSPIREHATE  10
#define ITEM_SPELL_STUN         11
#define ITEM_SPELL_SPIRITWRACK  12
#define ITEM_SPELL_BLOODGOUT    13
#define ITEM_SPELL_BLOODSHOWER  14
#define ITEM_SPELL_SPIRITDEATH  15
#define ITEM_SPELL_LIGHT        16
#define ITEM_SPELL_LIGHTNING    17
#define ITEM_SPELL_REPEL        18
#define ITEM_SPELL_ENERGYBOLT   19
#define ITEM_SPELL_INCAPACITATE 20
#define ITEM_SPELL_CONTROLMIND  21
#define ITEM_SPELL_SANCTUARY    22
#define ITEM_ARTIFACT_FLAY      23
#define ITEM_ARTIFACT_PENTALICH 24
#define ITEM_ARTIFACT_IMPLODE   25
#define ITEM_ARTIFACT_FONT      26
#define ITEM_ARTIFACT_BANK      27
#define ITEM_ARTIFACT_HEART     28
#define ITEM_ARTIFACT_ANTITOXIN 29
#define ITEM_ARTIFACT_SLOWTIME  30
#define ITEM_TOKEN_MOEBIUS      31
#define ITEM_TOKEN_DEJOULE      32
#define ITEM_TOKEN_DOLL         33
#define ITEM_TOKEN_MALEK        34
#define ITEM_TOKEN_AZIMUTH      35
#define ITEM_TOKEN_MORTANIUS    36
#define ITEM_TOKEN_NUPRAPTOR    37
#define ITEM_TOKEN_BANE         38
#define ITEM_TOKEN_SIGNETRING   39
#define ITEM_TOKEN_TIMEDEVICE   40
#define ITEM_TOKEN_ANACROTHE    41
#define ITEM_WEAPON_MACE        43
#define ITEM_WEAPON_AXES        44
#define ITEM_WEAPON_FLAMESWORD  45
#define ITEM_WEAPON_SOULREAVER  46
#define ITEM_ARMOR_BONE         48
#define ITEM_ARMOR_CHAOS        49
#define ITEM_ARMOR_FLESH        50
#define ITEM_ARMOR_WRAITH       51
#define ITEM_FORM_BAT           53
#define ITEM_FORM_WOLF          54
#define ITEM_FORM_DISGUISE      55
#define ITEM_FORM_MIST          56
#define ITEM_ENDING_1           69
#define ITEM_ENDING_2           70</text>
    </revision>
    <revision>
      <id>2838</id>
      <timestamp>2012-11-22T08:42:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map file */</comment>
      <text xml:space="preserve" bytes="8740">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's 4bit Very-Audio-Good files (ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. In PC versino they are unused. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collection.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    byte - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]])).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''variable bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same 

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).</text>
    </revision>
    <revision>
      <id>2839</id>
      <timestamp>2012-11-22T09:29:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* VAG */</comment>
      <text xml:space="preserve" bytes="8732">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collection.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    byte - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]])).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''variable bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same 

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).</text>
    </revision>
    <revision>
      <id>2840</id>
      <timestamp>2012-11-22T09:31:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Sprite type 2 */</comment>
      <text xml:space="preserve" bytes="8759">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    byte - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''variable bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]])).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''variable bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same 

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).</text>
    </revision>
    <revision>
      <id>2841</id>
      <timestamp>2012-11-22T09:34:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="8723">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    byte - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]])).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same 

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).</text>
    </revision>
    <revision>
      <id>2842</id>
      <timestamp>2012-11-22T09:35:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Sprite type 4 */</comment>
      <text xml:space="preserve" bytes="8729">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]])).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same 

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).</text>
    </revision>
    <revision>
      <id>2843</id>
      <timestamp>2012-11-22T10:17:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Tiles */</comment>
      <text xml:space="preserve" bytes="8727">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).</text>
    </revision>
    <revision>
      <id>2844</id>
      <timestamp>2012-11-22T10:59:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="32031">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most basic formats - such as .BIG file structure, TIM specs, were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70</text>
    </revision>
    <revision>
      <id>2846</id>
      <timestamp>2012-11-22T11:02:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="32031">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70</text>
    </revision>
    <revision>
      <id>2847</id>
      <timestamp>2012-11-22T11:11:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="32422">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PCX STR===
Used in Blood Omen PlayStation videos. STR is MJPEG video stream. jPsxDec tool could be used to decode this format into avi.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

===Credits===
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM</text>
    </revision>
    <revision>
      <id>2848</id>
      <timestamp>2012-11-22T11:25:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Video */</comment>
      <text xml:space="preserve" bytes="33048">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

===Credits===
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM</text>
    </revision>
    <revision>
      <id>2849</id>
      <timestamp>2012-11-22T11:30:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33338">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''typedef struct'''&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2854</id>
      <timestamp>2012-11-22T11:37:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33827">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2855</id>
      <timestamp>2012-11-22T11:38:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33297">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1===
Item cards. Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2856</id>
      <timestamp>2012-11-22T11:38:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Sprite type 1 */</comment>
      <text xml:space="preserve" bytes="33298">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4===
Multiframe sprite with shared palette, with additional frames headers. Used by actor sprites and effects. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2857</id>
      <timestamp>2012-11-22T11:39:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33340">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

===Index-based RLE===
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

===4-bit images===
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

===Variation of LZ77===

A variation of the LZ77 (LZ1) data compression algorithms.

Example decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2858</id>
      <timestamp>2012-11-22T11:40:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33338">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==Compression methods==

'''Index-based RLE'''
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''
A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE, some files using 4-bit color

Tricks:
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of Index-based compression

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using Index-based RLE

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (Index-based in 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2859</id>
      <timestamp>2012-11-22T11:44:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33437">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''
A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2860</id>
      <timestamp>2012-11-22T11:46:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33508">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] utility development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''
A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2861</id>
      <timestamp>2012-11-22T11:47:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33500">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

Tricks:
* There can be gaps between files

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''
A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2862</id>
      <timestamp>2012-11-22T11:47:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* BIG file */</comment>
      <text xml:space="preserve" bytes="33498">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

Tricks:
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

Tricks:
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

Tricks:
* Files have no header at all

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

Tricks:
* It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* Really, it is simplified sprite type 3

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

Tricks:
* In some files real width/height may be double of what written in header

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

Tricks:
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

Tricks:
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

Tricks:
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''
A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2863</id>
      <timestamp>2012-11-22T11:49:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33514">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''
Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''
Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''
A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2864</id>
      <timestamp>2012-11-22T11:49:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Compression methods */</comment>
      <text xml:space="preserve" bytes="33517">{{finished}}
{{grammar}}
This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]</text>
    </revision>
    <revision>
      <id>2875</id>
      <timestamp>2012-11-22T13:01:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33537">This page is dedicated to file formats used to store resources fo Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>2887</id>
      <timestamp>2012-11-22T21:41:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33541">This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>2897</id>
      <timestamp>2012-11-23T01:13:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33554">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>2945</id>
      <timestamp>2012-11-29T20:49:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Blood Omen file formats]] to [[Blood Omen/File formats]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="33554">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3121</id>
      <timestamp>2012-11-30T10:12:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Blood Omen/File formats]] to [[Blood Omen file formats]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="33554">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - unknown info
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3675</id>
      <timestamp>2013-10-02T08:37:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Added mark about damage mark from jonathan andre</comment>
      <text xml:space="preserve" bytes="33611">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found at [[Blood Pill]] sourcecode.

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - damage mark. A value of 1 tell the game to deal damage in this frame.
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3686</id>
      <timestamp>2013-10-06T14:43:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33657">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found [https://github.com/paulvortex/BloodPill/blob/master/src/timfile.cpp here].

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found in [[Blood Pill]] sourcecode.

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - damage mark. A value of 1 tell the game to deal damage in this frame.
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3687</id>
      <timestamp>2013-10-06T14:45:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33703">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found [https://github.com/paulvortex/BloodPill/blob/master/src/timfile.cpp here].

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found [https://github.com/paulvortex/BloodPill/blob/master/src/vagfile.cpp here].

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found in [[Blood Pill]] sourcecode.

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - damage mark. A value of 1 tell the game to deal damage in this frame.
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3688</id>
      <timestamp>2013-10-06T14:46:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="33748">{{TOCRIGHT}}
This page is dedicated to the specifications for file formats used in Blood Omen. It encompasses exploring work done by the community since Blood Omen was released. 

Most simple formats (such as .BIG file structure, TIM specs) were unveiled long time ago, but some ones (map format, sprites) was unveiled lately during [[Blood Pill]] development.

==BIG file==
This is general file storing all game resources. It's structure is quite simple:

 '''uint32''' - number of entries
 &lt;span style=&quot;color:green&quot;&gt;Array of entries:&lt;/span&gt;
   '''uint32''' - Hashed name of file
   '''uint32''' - File size
   '''uint32''' - File offset
 &lt;span style=&quot;color:green&quot;&gt;Array of entry data:&lt;/span&gt;
   '''bytes''' - File contents

{{tip|There can be gaps between files}}

==TIM image==
Playstation images. Used to store graphics and tiles. TIM specs are widely known, so it will be not listed here. Reference decoder/encoder can be found [https://github.com/paulvortex/BloodPill/blob/master/src/timfile.cpp here].

'''Tips''':
* Some pill.big entries can contain several TIM's glued together.
* Some blood omen TIM files can contain tails with nulls.

==Sounds==

===VAG===
Playstation's Very-Audio-Good files (4-bit ADPCM variation) used in blood omen playstation version and by blood omen sneak peek preview. Unused in PC version. Reference decoder/encoder can be found [https://github.com/paulvortex/BloodPill/blob/master/src/vagfile.cpp here].

'''Tips''':
* Many VAG files are headerless (having mess in the header, even no 'VAGb' fourCC, hence could only be detected by direct parsing).
* Normally should be played at 11025hz, but some ones (music and some sounds) at 22050hz

===RAW IMA ADPCM===
Headerless files containing raw IMA ADPCM stream to replaces VAG files in PC version. They are using exactly same file names as VAG files in playstation version.

{{tip|Files have no header at all}}

===Waveform Audio File===
Blood Omen PC version have some sounds in .WAV format (playstation have them in .VAG). This format is widely known and does not need to be explained.

{{tip|It seems game doesnt use WAV headers, some file have bogus play rate and should be tweaked manually to play with correct rate thay listened in game}}

==Video==

===PSX STR===
Used in Blood Omen PlayStation version. STR is MJPEG video stream with interleaved audio. [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] tool could be used to extract and decode this format from playstation CD images.

===JAM Videos===
JAM is lossy video compression format developed by Semilogic entertainment and used in Blood Omen PC version. The format uses shared palette for several frames and a form of dynamic compression. JAM spec and decoder was unveiled in 2011 by MisterGrim. JAM can only store video, audio was stored in separate .VAG file (which was for real, raw IMA ADPCM).

JAM videos have much more artifacts than STR, sound track is mono (STR have stereo).

JAM decompressing code can be found [https://github.com/paulvortex/BloodPill/blob/master/src/jamfile.cpp here]

==Sprites==

Sprites are images of characters and animated stuff. There are 3 extensions as of filenames: SHA, SDR, SHD. However, when Blood Pill was developed, there were no knowledge of real file names, so this spec will define &quot;Sprite types&quot; which covers unpacking of all sprites, including unused ones.

===Sprite type 1 - Item Cards===
Always have 1 frame and no compression used. 

 '''uint32''' - always 0x01 0x00 0x00 0x00 
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (256 colors)
 '''int16''' - x position
 '''int16''' - y position
 '''byte''' - width
 '''byte''' - height
 '''byte''' - x
 '''byte''' - y
 '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|Really, it is simplified sprite type 3}}

===Sprite type 2 - Images collection===
Multiframe sprite with per-frame palette. Used by interface images collections (such as spell/item pics).

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data (unused)
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''768 bytes''' - 24-bit colormap data
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''width*height bytes''' - picture contents (indexes into colormap)

{{tip|In some files real width/height may be double of what written in header}}

===Sprite type 3 - Object sprites===
Multiframe sprite with shared palette.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encodingE, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 4 - character sprites===
Multiframe sprite with shared palette, with additional frames headers. Used by characters. Pretty same as type 3.

 '''uint32''' - number of frames
 '''uint32''' - file size
 &lt;span style=&quot;color:green&quot;&gt;Array of additional frame headers (rounded to the greatest multiplier of 4):&lt;/span&gt;
    '''byte''' - damage mark. A value of 1 tell the game to deal damage in this frame.
 '''768 bytes''' - 24-bit colormap data
 '''int16''' - x offset for all frames
 '''int16''' - y offset for all frames
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using run-length encoding, some files using 4-bit color (see [[#Compression methods]])

'''Tips''':
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded
* Some files are using 4-bit color instead of RLE

===Sprite type 5===
Another variation of type 3 with no offset info and (sometimes) broken width/height, which should be fixed with special trick.

 '''uint32''' - number of frames
 '''uint32''' - file size
 '''768 bytes''' - 24-bit colormap data
 &lt;span style=&quot;color:green&quot;&gt;Array of frame headers:&lt;/span&gt;
   '''uint32''' - offset to the picture data from the end of headers
   '''ubyte''' - width
   '''ubyte''' - height
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array of frame picture data:&lt;/span&gt;
   '''bytes''' - compressed picture contents (indexes into colormap) using RLE  (see [[#Compression methods]])

'''Tips''':
* Some frames have broken width/height because they width is above 255 and format uses 1 byte to encode it, 255 + [width] should be used to correct this
* It is unknown how to get what compression file do use (RLE on 0x00, or 0xFF or both), it seems engine gives that info when file get loaded

==Maps==

Maps are central thing which brings all resources (images, sounds, tiles, sprites) together. There is about 80% of map structure revealed, allowing to extract general amount of things from it, including: textures used, a map image, monster/effect/item placement, triggers, info marks, doors and buttons etc.

Each map has a mapnum and section that is included in filename. That info is used to place map in a global adventure map (see [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] for complete info about level naming).

=== Tiles ===
Tiles are 256-color TIM images compressed with LZ77 (see [[#Compression methods]]).

Each tile texture has 8x8 = 64 tiles. Engine renders all tile separately, switching current tile texture as needed.

 '''uint32''' - compressed data size
 '''bytes''' - compressed data

'''Tips''':
* Since all tiles are 8-bit 256x256 TIM, unpacked data size is always same

=== Map file ===

Map file is fixed-length structure which holds tiles placement (80x80), enemies, lights, buttons and other objects to form Blood Omen level. Because of it's fixed nature, there are many limits, and each map file have exactly same size (so it can just be copied into memory).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// first parm, if script is not defined it's 0xFFFF, 0xFFFE is null value&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - destination/source map number (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - speech num (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// second parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - button num (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - pic num (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// destination/source map section (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// sposition&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// script type, one of TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// map item&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// one of MAPITEM_ code&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// set to 1 if item is spawned by trigger (like barrel destruction)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// targeted triggergroup&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// animated tile&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// a triggergroup&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contents, see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// alternate state contents&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// button controller&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// a triggergroup to call&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// tilenum&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// alternate state tilenum&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// see BUTTONFLAG_* defs&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effect&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// position of lightsource&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// index of sprite from sprites array&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// size of light polygons&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// light form flags&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// red color component&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// green color component&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// darkblue color component&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// triggergroup&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 if effect starts on, 0 if starts off&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tile object definition (barrels, chests)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// start position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// end position&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// width&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// height&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// multiply by 16 to get real offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// scenery entities&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// base tile (grpobject really, not standart 32x32 tile)&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// toggled tile (grpobject)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// destroyed tilee (grpobject)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// a strength required to push&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// trigger can toggle it's state (means tile2 is there)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// item codes to spawn when toggled/destroyed&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// destructible flags&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 is filled, otherwise 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy paths&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// enemy entity&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// patrole paths&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// unique savegame id&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// monster class (same as char* sprite)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// triggergroup to call once killed&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// position&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// a speech number for disguise talk&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// general map file structure&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// a chain of tilemap numbers used (to make a filenames)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// each tilemap holds 64 tiles, tiles numbering is linear&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// like, a tile #131 is tile #3 from tilemap #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// being 2-'''byte''' ('''unsigned short''') tilenum contains some flags (flag are starting from '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see TILEFLAG_ defines for possible tileflags&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles - a tiles that can be toggled between 2 states and have different contents for each state&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// used on doors, spikes that pops up on the floor etc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// animated tiles have triggergroup to be executed by script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// a special buttons array holds all buttons used on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// pretty similar to animated tiles&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// buttons have triggergroup to be executed by script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown info #2&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// scenery pushable objects - tables, chairs, stones etc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// first tilemap&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// second tilemap&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// contents map - a contents value for each static tile (in game they get overriden by switchable tiles if presented)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// see CONTENTS_ defines for possible content values&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// items placed on level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// itemcodes 0-9 are powerups, codes 10, 11, 12, 13 reserved for unique item codes&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// so there will be not more than 4 unique item type per level&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// unique items are: spells, weapons, forms, artifacts, tokens&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effects&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// yet unknown data&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// things that are not figured out yet:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - how lightning is done (variable form lights, day-night light, ambient light)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - monster's paths's switch (some paths are messed up)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counters and puzzle triggers?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// tileflags&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contents&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// triggers&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// button flags&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// item codes&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// unique item codes&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Compression methods==

'''Index-based Run Length Encoding (RLE)'''

Used on sprite data to compress black areas which is normally transparent. This technique alters reading process of byte 0x0 and 0xFF. If got this byte when reading picture data, should read 1 byte more which will be times to repeat this byte. Blood Omen RLE only used for values 0x00 or 0xFF.
    
Example: 

 &lt;span style=&quot;color:green&quot;&gt;// output 32 bytes with value 0xFF&lt;/span&gt;
 0xFF 0x20

'''4-bit images'''

Encode 2 pixels per byte with 256 color palette but with only 16 colors used (other pixels are black).

For each byte it produces 2 bytes in order:
* byte 1 : &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2 : (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Example:

  231 will output 2 pixels with values:
  byte 1 : 7
  byte 2 : 14

'''Variation of LZ77'''

A variation of the LZ77 (LZ1) data compression algorithms.

Sample decoder can be found at [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] and [[Blood Pill]] sourcecode.

==Credits==
* Andrey [Rackot] Grachev - Bigfile specs
* Pavel [VorteX] Timofeyev - Map file, sprites
* Ben Lincoln - LZ77 decompressor
* JAM decoding specs by MisterGrim
* Balder and Zench from XentaX forums (www.xentax.com) - IMA ADPCM

==See also==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]

__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
  </page>
  <page>
    <title>Blood Omen/Characters</title>
    <ns>0</ns>
    <id>317</id>
      <sha1>0jz26helf1s7wu6w219d20amfry5xho</sha1>
    <revision>
      <id>2947</id>
      <timestamp>2012-11-29T21:20:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;==Animals== * [[Blood Omen/Characters/Cave abomination|Cave Abomination]] * [[Blood Omen/Characters/Cave wolf|Cave wolf]] * [[Blood Omen/Characters/Dog|Dog]] * [[Blood Omen/Ch...&quot;</comment>
      <text xml:space="preserve" bytes="1872">==Animals==
* [[Blood Omen/Characters/Cave abomination|Cave Abomination]]
* [[Blood Omen/Characters/Cave wolf|Cave wolf]]
* [[Blood Omen/Characters/Dog|Dog]]
* [[Blood Omen/Characters/Insect beast|Insect beast]]
* [[Blood Omen/Characters/Manslug|Manslug]]
* [[Blood Omen/Characters/Pulse monster|Pulse monster]]
* [[Blood Omen/Characters/Sawtooth|Sawtooth]]
==Civilians==
* [[Blood Omen/Characters/Artisan|Artisan]]
* [[Blood Omen/Characters/Butcher|Butcher]]
* [[Blood Omen/Characters/Captive|Captive]]
* [[Blood Omen/Characters/Civil|Civil]]
* [[Blood Omen/Characters/Irmok|Irmok]]
* [[Blood Omen/Characters/Grave digger|Grave digger]]
* [[Blood Omen/Characters/Gypsy|Gypsy]]
* [[Blood Omen/Characters/Lodger|Lodger]]
* [[Blood Omen/Characters/Maid servant|Maid servant]]
* [[Blood Omen/Characters/Merchant man|Merchant man]]
* [[Blood Omen/Characters/Miner|Miner]]
* [[Blood Omen/Characters/Noble girl|Noble girl]]
* [[Blood Omen/Characters/Old man|Old man]]
* [[Blood Omen/Characters/Peasant|Peasant]]
* [[Blood Omen/Characters/Ragged fellow|Ragged fellow]]
* [[Blood Omen/Characters/Smith|Smith]]
* [[Blood Omen/Characters/Traveller|Traveller]]
* [[Blood Omen/Characters/Townkeep|Townkeep]]
* [[Blood Omen/Characters/Villager|Villager]]
* [[Blood Omen/Characters/Wench|Wench]]
* [[Blood Omen/Characters/Workman|Workman]]
==Human combatants==
* [[Blood Omen/Characters/Brigand|Brigand]]
* [[Blood Omen/Characters/Rogue|Rogue]]
* [[Blood Omen/Characters/Gypsy knifethrower|Gypsy knifethrower]]
* [[Blood Omen/Characters/Gypsy warrior|Gypsy warrior]]
* [[Blood Omen/Characters/Dervish|Dervish]]
* [[Blood Omen/Characters/Cultist|Cultist]]
* [[Blood Omen/Characters/Guard|Guard]]
* [[Blood Omen/Characters/Willendorf soldier|Willendorf soldier]]
* [[Blood Omen/Characters/Nemesis legionnaire|Nemesis legionnaire]]
* [[Blood Omen/Characters/Vampire hunter|Vampire hunter]]</text>
    </revision>
    <revision>
      <id>3002</id>
      <timestamp>2012-11-29T22:44:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="655">==Animals==
* [[Cave Abomination]]
* [[Cave wolf]]
* [[Dog]]
* [[Insect beast]]
* [[Manslug]]
* [[Pulse monster]]
* [[Sawtooth]]
==Civilians==
* [[Artisan]]
* [[Butcher]]
* [[Captive]]
* [[Civil]]
* [[Irmok]]
* [[Grave digger]]
* [[Gypsy]]
* [[Lodger]]
* [[Maid servant]]
* [[Merchant man]]
* [[Miner]]
* [[Noble girl]]
* [[Old man]]
* [[Peasant]]
* [[Ragged fellow]]
* [[Smith]]
* [[Traveller]]
* [[Townkeep]]
* [[Villager]]
* [[Wench]]
* [[Workman]]
==Human combatants==
* [[Brigand]]
* [[Rogue]]
* [[Gypsy knifethrower]]
* [[Gypsy warrior]]
* [[Dervish]]
* [[Cultist]]
* [[Guard]]
* [[Willendorf soldier]]
* [[Nemesis legionnaire]]
* [[Vampire hunter]]</text>
    </revision>
    <revision>
      <id>3003</id>
      <timestamp>2012-11-29T22:44:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="655">==Animals==
* [[Cave abomination]]
* [[Cave wolf]]
* [[Dog]]
* [[Insect beast]]
* [[Manslug]]
* [[Pulse monster]]
* [[Sawtooth]]
==Civilians==
* [[Artisan]]
* [[Butcher]]
* [[Captive]]
* [[Civil]]
* [[Irmok]]
* [[Grave digger]]
* [[Gypsy]]
* [[Lodger]]
* [[Maid servant]]
* [[Merchant man]]
* [[Miner]]
* [[Noble girl]]
* [[Old man]]
* [[Peasant]]
* [[Ragged fellow]]
* [[Smith]]
* [[Traveller]]
* [[Townkeep]]
* [[Villager]]
* [[Wench]]
* [[Workman]]
==Human combatants==
* [[Brigand]]
* [[Rogue]]
* [[Gypsy knifethrower]]
* [[Gypsy warrior]]
* [[Dervish]]
* [[Cultist]]
* [[Guard]]
* [[Willendorf soldier]]
* [[Nemesis legionnaire]]
* [[Vampire hunter]]</text>
    </revision>
  </page>
  <page>
    <title>Blood Omnicide Locations</title>
    <ns>0</ns>
    <id>16</id>
      <sha1>9bzjj8wvq1mdtoqijbw622zqblj9ct8</sha1>
    <revision>
      <id>125</id>
      <timestamp>2012-07-02T19:08:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;= Introduction =  = Worlds =  Each worlds represents a worldmap. A worldmap have locations, each location have sub-locations.  == Blood Omnicide Worlds ===  {|  ! World #  ! N...&quot;</comment>
      <text xml:space="preserve" bytes="246">= Introduction =

= Worlds =

Each worlds represents a worldmap. A worldmap have locations, each location have sub-locations.

== Blood Omnicide Worlds ===

{| 
! World # 
! Name
|-
| 0
| Prologue
|-
| 1
| Present
|-
| 2
| Past
|-
| 3
| Future
|}</text>
    </revision>
    <revision>
      <id>126</id>
      <timestamp>2012-07-02T19:08:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="330">= Introduction =

= Worlds =

Each worlds represents a worldmap. A worldmap have locations, each location have sub-locations.

== Blood Omnicide Worlds ===

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
|-
| 1
| Present
|-
| 2
| Past
|-
| 3
| Future
|}</text>
    </revision>
    <revision>
      <id>127</id>
      <timestamp>2012-07-02T19:10:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="501">= Introduction =

= Worlds =

Each worlds represents a worldmap. A worldmap have locations, each location have sub-locations.

== Blood Omnicide Worlds ===

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies
|-
| 1
| Present
| Most part of the game, until Kain travels back in time
|-
| 2
| Past
| 50 years before Kain's murder
|-
| 3
| Future
| Epilogue, when kain returns back from the past.
|}</text>
    </revision>
    <revision>
      <id>128</id>
      <timestamp>2012-07-02T19:11:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="476">= Introduction =

= Level naming =

Each worlds represents a worldmap. 

A worldmap have locations, each location have sub-locations.



{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}</text>
    </revision>
    <revision>
      <id>129</id>
      <timestamp>2012-07-02T19:11:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="474">= Introduction =

= Level naming =

Each worlds represents a worldmap. 

A worldmap have locations, each location have sub-locations.

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}</text>
    </revision>
    <revision>
      <id>130</id>
      <timestamp>2012-07-02T19:12:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="570">= Introduction =

= Level naming =

Each worlds represents a worldmap. 

A worldmap have locations, each location have sub-locations.

Generic location name is w''worldnum''m''locationnum''-''location_name''-''sub-location_name''

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}</text>
    </revision>
    <revision>
      <id>131</id>
      <timestamp>2012-07-02T19:13:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level naming */</comment>
      <text xml:space="preserve" bytes="578">= Introduction =

= Level naming =

Each worlds represents a worldmap. 

A worldmap have locations, each location have sub-locations.

Generic location name is w[''worldnum'']m[''locationnum']'-[''location_name'']-[''sub-location_name'']

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}</text>
    </revision>
    <revision>
      <id>132</id>
      <timestamp>2012-07-02T19:13:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="606">= Introduction =

= Level naming =

Each worlds represents a worldmap. 

A worldmap have locations, each location have sub-locations.

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}</text>
    </revision>
    <revision>
      <id>133</id>
      <timestamp>2012-07-02T19:18:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level naming */</comment>
      <text xml:space="preserve" bytes="1005">= Introduction =

= Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}

= Map file naming =

A world have locations, each location have sub-locations.

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt

= Prologue maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=60% | Original maps
|- | w0m1-ziegsturhl | '''Ziegsturhl''' | m70-10
|- | w0m1-ziegsturhl-inn | Ziegsturhl inn | m70-01
|- | w0m1-ziegsturhl-inn | Ziegsturhl public house| m70-0
|}</text>
    </revision>
    <revision>
      <id>134</id>
      <timestamp>2012-07-02T19:19:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1014">= Introduction =

= Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}

= Map file naming =

A world have locations, each location have sub-locations.

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt

= Prologue maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=60% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| m70-0
|}</text>
    </revision>
    <revision>
      <id>135</id>
      <timestamp>2012-07-02T19:20:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1015">= Introduction =



= Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= Map naming =

A world have locations, each location have sub-locations.

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt



= Prologue maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=60% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| m70-0
|}</text>
    </revision>
    <revision>
      <id>136</id>
      <timestamp>2012-07-02T19:21:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Prologue maps */</comment>
      <text xml:space="preserve" bytes="1048">= Introduction =



= Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= Map naming =

A world have locations, each location have sub-locations.

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt



= Prologue maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Music themes
! width=50% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
|
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
|
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
|
| m70-0
|}</text>
    </revision>
    <revision>
      <id>137</id>
      <timestamp>2012-07-02T19:22:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1114">= Introduction =



= Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= Map naming =

A world have locations, each location have sub-locations.

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt



= Prologue maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|}</text>
    </revision>
    <revision>
      <id>138</id>
      <timestamp>2012-07-02T19:24:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1141">= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Generic location name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt

= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}






= All Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|}</text>
    </revision>
    <revision>
      <id>139</id>
      <timestamp>2012-07-02T19:25:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1133">= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt

= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}






= All Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|}</text>
    </revision>
    <revision>
      <id>140</id>
      <timestamp>2012-07-02T19:25:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1174">= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt

= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| colspan=3 | '''World 0: Prologue'''
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}






= All Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|}</text>
    </revision>
    <revision>
      <id>141</id>
      <timestamp>2012-07-02T19:26:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1211">= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt

= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= All Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|-
| colspan=5 | '''World 0: Prologue'''
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|-
| colspan=5 | '''World 1: Present'''
|}</text>
    </revision>
    <revision>
      <id>142</id>
      <timestamp>2012-07-02T19:26:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1212">= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt


= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= All Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|-
| colspan=5 | '''World 0: Prologue'''
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|-
| colspan=5 | '''World 1: Present'''
|}</text>
    </revision>
    <revision>
      <id>143</id>
      <timestamp>2012-07-02T19:27:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* All Blood Omnicide Maps */</comment>
      <text xml:space="preserve" bytes="1208">= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt


= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|-
| colspan=5 | '''World 0: Prologue'''
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|-
| colspan=5 | '''World 1: Present'''
|}</text>
    </revision>
    <revision>
      <id>1213</id>
      <timestamp>2012-07-18T09:13:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1232">{{article unfinished}}

= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt


= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|-
| colspan=5 | '''World 0: Prologue'''
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|-
| colspan=5 | '''World 1: Present'''
|}</text>
    </revision>
    <revision>
      <id>1998</id>
      <timestamp>2012-07-27T14:00:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1224">{{unfinished}}

= Introduction =

= Map hierarchy =

* '''World''' 
** '''Locations'''
*** '''Sub-locations'''

Map file name is '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

Examples: w1m1-cemetery, w1m2-pillars-crypt


= Blood Omnicide Worlds =

Each worlds represents a worldmap. 

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! World # 
! Name
! Description
|-
| 0
| Prologue
| Game prologue until Kain dies.
|-
| 1
| Present
| Most part of the game, until Kain travels back in time.
|-
| 2
| Past
| 50 years before Kain's murder.
|-
| 3
| Epilogue
| When Kain returns back from the past.
|}



= Blood Omnicide Maps =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse; width: 100%&quot;
! width=15% | Map file
! width=25% | Map name
! width=10% | Map type
! width=10% | Music themes
! width=40% | Original maps
|-
| colspan=5 | '''World 0: Prologue'''
|- 
| w0m1-ziegsturhl 
| '''Ziegsturhl''' 
| outdoor
| null
| m70-10
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl inn 
| house
| house
| m70-01
|- 
| w0m1-ziegsturhl-inn 
| Ziegsturhl public house
| house
| house
| m70-0
|-
| colspan=5 | '''World 1: Present'''
|}</text>
    </revision>
  </page>
  <page>
    <title>Blood Omnicide complete feature list</title>
    <ns>0</ns>
    <id>313</id>
      <sha1>oydyzo251crxw37lf7yls6j4k0jspid</sha1>
    <revision>
      <id>2933</id>
      <timestamp>2012-11-28T18:33:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{grammar}} {{unfinished}} {{TOCRIGHT}} This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: L...&quot;</comment>
      <text xml:space="preserve" bytes="3542">{{grammar}}
{{unfinished}}
{{TOCRIGHT}}
This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: Legacy of Kain. All features are added using &quot;extend, not break&quot; paradigm. And all changes are targeted to make better gameplay with new 3D environments. Features that are optional is marked italic. Not all features can be optional however. We are making game, not some kind of constructor.

Features that can't be made optional and prove breakage to game feel, will be removed.

===Graphics===
* ''Modern hud'';
* ''Modern worldmap style'';
* ''Custom or automatic color for magic (automatic is based on biggest sphere was picked up)'';
* ''Subtitles for speech (classic and above-the-head)'';
* ''Subtitles for videos'';
===Sound===
* Different hit sound based on surface type;
* ''New musical themes: extended (new tracks from Bloody Sounds) and modern (new tracks &amp; remixes from Bloody Sounds)'';
* ''Footstep sounds'';
===Gameplay general===
* ''Game speed: normal (PC), fast, faster (Playstation-like)'';
* All melee weapons now using blade path tracing.
* Nosgoth Blood Script can now be translated. This means different languages can have different rune alphabet.
* Some secrets are changed, so needs to be found again;
* Camera is slightly higher than in Blood Omen;
===New abilities based on spell/attack hold delay===
* Autoaim for straightforward spells &amp; artifacts (energy bolt, implode) - 15 degrees around look direction (activated by holding spell more than 1 second);
* Soul Reaver can optionally use normal attack (does slightly more damage than iron sword) if attack is hold less than 0.5 sec;
* Long jump for lupon form (which can get really far) - press jump and move button of current look direction at same time;
* Axes combos now using &quot;rage meter&quot; which grows once player presses attack. To launch &quot;whirlwind&quot; attack player should do 6 or more pressing per second for 2 seconds, by making 2 or more pressing for second, a series of hits combo is launched (can make long series of 20-30 hits);
===Combat changes===
* Sword attacks faster;
* Axes attacks faster;
* Enemies attack faster;
* Flay homing are more smooth, also artifact can miss in some cases (when enemy runs out of flay velocity line and flay speed was too high to correct);
* The chance for &quot;Vae Victus&quot; and Kain's laugh are greatly reduced;
* Slow Time spell now affects all world around Kain, instead of just enemies. This means that missiles are slowed down too, as well as torch flames, rain particles, gravity, everything that is not Kain;
===Captives===
* The chance for &quot;Please help me kind sir&quot; are reduced, speech are only played when Kain is close enough;
===Enemies===
* Throwers do attack at 360 degree (was 8 directions only);
* AI reacts faster, can chase Kain and follow him;
* Melee enemies have better knowledge how to attack player;
* Town characters flee when see Kain;
===Interactivity===
* New marks to observe the world
* Can break, kick and push environments in houses
* All puzzles are randomized. Each time you begin game, puzzles you meet (there are not many ot them though) will be different.
* Some of original map downfalls now considered instant death zones - once kain falls to the gulf, it loses one Heart of Darkness and get teleported to safe place.
* Forest are semi-walkable now, allowing to reach new places and secrets
===Prologue changes===
* Kain cannot attack in tavern, this limit was added for speech sanity (Kain says 'and so i left').</text>
    </revision>
    <revision>
      <id>2944</id>
      <timestamp>2012-11-29T12:27:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3723">{{grammar}}
{{unfinished}}
{{TOCRIGHT}}
This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: Legacy of Kain. All features are added using &quot;extend, not break&quot; paradigm. And all changes are targeted to make better gameplay with new 3D environments. Features that are optional is marked italic. Not all features can be optional however. We are making game, not some kind of constructor.

Features that can't be made optional and prove breakage to game feel, will be removed.

===Graphics===
* ''Modern hud'';
* ''Modern worldmap style'';
* ''Custom or automatic color for magic (automatic is based on biggest sphere was picked up)'';
* ''Subtitles for speech (classic and above-the-head)'';
* ''Subtitles for videos'';
===Sound===
* Different hit sound based on surface type;
* ''New musical themes: extended (new tracks from Bloody Sounds) and modern (new tracks &amp; remixes from Bloody Sounds)'';
* Music are crossfaded between levels. If next level will play same track, music is not restarted.
* ''Footstep sounds'';
* New ambient and combat sounds;
===Gameplay general===
* ''Game speed: normal (PC), fast, faster (Playstation-like)'';
* All melee weapons now using blade path tracing.
* Nosgoth Blood Script can now be translated. This means different languages can have different rune alphabet.
* Some secrets are changed, so needs to be found again;
* Camera is slightly higher than in Blood Omen;
===New abilities based on spell/attack hold delay===
* Autoaim for straightforward spells &amp; artifacts (energy bolt, implode) - 15 degrees around look direction (activated by holding spell more than 1 second);
* Soul Reaver can optionally use normal attack (does slightly more damage than iron sword) if attack is hold less than 0.5 sec;
* Long jump for lupon form (which can get really far) - press jump and move button of current look direction at same time;
* Axes combos now using &quot;rage meter&quot; which grows once player presses attack. To launch &quot;whirlwind&quot; attack player should do 6 or more pressing per second for 2 seconds, by making 2 or more pressing for second, a series of hits combo is launched (can make long series of 20-30 hits);
===Combat changes===
* Sword attacks faster;
* Axes attacks faster;
* Enemies attack faster;
* Flay homing are more smooth, also artifact can miss in some cases (when enemy runs out of flay velocity line and flay speed was too high to correct);
* The chance for &quot;Vae Victus&quot; and Kain's laugh are greatly reduced;
* Slow Time spell now affects all world around Kain, instead of just enemies. This means that missiles are slowed down too, as well as torch flames, rain particles, gravity, everything that is not Kain;
===Captives===
* The chance for &quot;Please help me kind sir&quot; are reduced, speech are only played when Kain is close enough;
===Enemies===
* Throwers do attack at 360 degree (was 8 directions only);
* AI reacts faster, can chase Kain and follow him;
* Melee enemies have better knowledge how to attack player;
* Town characters flee when see Kain;
===Interactivity===
* New marks to observe the world
* Can break, kick and push environments in houses
* All puzzles are randomized. Each time you begin game, puzzles you meet (there are not many ot them though) will be different.
* Some of original map downfalls now considered instant death zones - once kain falls to the gulf, it loses one Heart of Darkness and get teleported to safe place.
* Forest are semi-walkable now, allowing to reach new places and secrets
* Random weather cycle (original one was fixed).
===Prologue changes===
* Kain cannot attack in tavern, this limit was added for speech sanity (Kain says 'and so i left').</text>
    </revision>
    <revision>
      <id>3279</id>
      <timestamp>2012-11-30T12:51:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3777">{{grammar}}
{{TOCRIGHT}}
This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: Legacy of Kain. All features are added using &quot;extend, not break&quot; paradigm. And all changes are targeted to make better gameplay with new 3D environments. Features that are optional is marked italic. Not all features can be optional however. We are making game, not some kind of constructor.http://omnicide.legacy-of-kain.ru/w/index.php/Main_Page

Features that can't be made optional and prove breakage to game feel, will be removed.

===Graphics===
* ''Modern hud'';
* ''Modern worldmap style'';
* ''Custom or automatic color for magic (automatic is based on biggest sphere was picked up)'';
* ''Subtitles for speech (classic and above-the-head)'';
* ''Subtitles for videos'';
===Sound===
* Different hit sound based on surface type;
* ''New musical themes: extended (new tracks from Bloody Sounds) and modern (new tracks &amp; remixes from Bloody Sounds)'';
* Music are crossfaded between levels. If next level will play same track, music is not restarted.
* ''Footstep sounds'';
* New ambient and combat sounds;
===Gameplay general===
* ''Game speed: normal (PC), fast, faster (Playstation-like)'';
* All melee weapons now using blade path tracing.
* Nosgoth Blood Script can now be translated. This means different languages can have different rune alphabet.
* Some secrets are changed, so needs to be found again;
* Camera is slightly higher than in Blood Omen;
===New abilities based on spell/attack hold delay===
* Autoaim for straightforward spells &amp; artifacts (energy bolt, implode) - 15 degrees around look direction (activated by holding spell more than 1 second);
* Soul Reaver can optionally use normal attack (does slightly more damage than iron sword) if attack is hold less than 0.5 sec;
* Long jump for lupon form (which can get really far) - press jump and move button of current look direction at same time;
* Axes combos now using &quot;rage meter&quot; which grows once player presses attack. To launch &quot;whirlwind&quot; attack player should do 6 or more pressing per second for 2 seconds, by making 2 or more pressing for second, a series of hits combo is launched (can make long series of 20-30 hits);
===Combat changes===
* Sword attacks faster;
* Axes attacks faster;
* Enemies attack faster;
* Flay homing are more smooth, also artifact can miss in some cases (when enemy runs out of flay velocity line and flay speed was too high to correct);
* The chance for &quot;Vae Victus&quot; and Kain's laugh are greatly reduced;
* Slow Time spell now affects all world around Kain, instead of just enemies. This means that missiles are slowed down too, as well as torch flames, rain particles, gravity, everything that is not Kain;
===Captives===
* The chance for &quot;Please help me kind sir&quot; are reduced, speech are only played when Kain is close enough;
===Enemies===
* Throwers do attack at 360 degree (was 8 directions only);
* AI reacts faster, can chase Kain and follow him;
* Melee enemies have better knowledge how to attack player;
* Town characters flee when see Kain;
===Interactivity===
* New marks to observe the world
* Can break, kick and push environments in houses
* All puzzles are randomized. Each time you begin game, puzzles you meet (there are not many ot them though) will be different.
* Some of original map downfalls now considered instant death zones - once kain falls to the gulf, it loses one Heart of Darkness and get teleported to safe place.
* Forest are semi-walkable now, allowing to reach new places and secrets
* Random weather cycle (original one was fixed).
===Prologue changes===
* Kain cannot attack in tavern, this limit was added for speech sanity (Kain says 'and so i left').

{{finished}}</text>
    </revision>
    <revision>
      <id>3356</id>
      <timestamp>2013-01-15T15:27:18Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3777">{{grammar}}
{{TOCRIGHT}}
This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: Legacy of Kain. All features are added using &quot;extend, not break&quot; paradigm. And all changes are targeted to make better gameplay with new 3D environments. Features that are optional is marked italic. Not all features can be optional however. We are making game, not some kind of constructor.http://omnicide.legacy-of-kain.ru/w/index.php/Main_Page

Features that can't be made optional and prove breakage to game feel, will be removed.

===Graphics===
* ''Modern hud'';
* ''Modern worldmap style'';
* ''Custom or automatic color for magic (automatic is based on biggest sphere was picked up)'';
* ''Subtitles for speech (classic and above-the-head)'';
* ''Subtitles for videos'';
===Sound===
* Different hit sound based on surface type;
* ''New musical themes: extended (new tracks from Bloody Sounds) and modern (new tracks &amp; remixes from Bloody Sounds)'';
* Music are crossfaded between levels. If next level will play same track, music is not restarted.
* ''Footstep sounds'';
* New ambient and combat sounds;
===Gameplay general===
* ''Game speed: normal (PC), fast, faster (Playstation-like)'';
* All melee weapons now using blade path tracing.
* Nosgoth Blood Script can now be translated. This means different languages can have different rune alphabet.
* Some secrets are changed, so needs to be found again;
* Camera is slightly higher than in Blood Omen;
===New abilities based on spell/attack hold delay===
* Autoaim for straightforward spells &amp; artifacts (energy bolt, implode) - 15 degrees around look direction (activated by holding spell more than 1 second);
* Soul Reaver can optionally use normal attack (does slightly more damage than iron sword) if attack is hold less than 0.5 sec;
* Long jump for lupon form (which can get really far) - press jump and move button of current look direction at same time;
* Axes combos now using &quot;rage meter&quot; which grows once player presses attack. To launch &quot;whirlwind&quot; attack player should do 6 or more pressing per second for 2 seconds, by making 2 or more pressing for second, a series of hits combo is launched (can make long series of 20-30 hits);
===Combat changes===
* Sword attacks faster;
* Axes attacks faster;
* Enemies attack faster;
* Flay homing are more smooth, also artifact can miss in some cases (when enemy runs out of flay velocity line and flay speed was too high to correct);
* The chance for &quot;Vae Victus&quot; and Kain's laugh are greatly reduced;
* Slow Time spell now affects all world around Kain, instead of just enemies. This means that missiles are slowed down too, as well as torch flames, rain particles, gravity, everything that is not Kain;
===Captives===
* The chance for &quot;Please help me kind sir&quot; are reduced, speech are only played when Kain is close enough;
===Enemies===
* Throwers do attack at 360 degree (was 8 directions only);
* AI reacts faster, can chase Kain and follow him;
* Melee enemies have better knowledge how to attack player;
* Town characters flee when see Kain;
===Interactivity===
* New marks to observe the world
* Can break, kick and push environments in houses
* All puzzles are randomized. Each time you begin game, puzzles you meet (there are not many ot them though) will be different.
* Some of original map downfalls now considered instant death zones - once kain falls to the gulf, it loses one Heart of Darkness and get teleported to safe place.
* Forest are semi-walkable now, allowing to reach new places and secrets
* Random weather cycle (original one was fixed).
===Prologue changes===
* Kain cannot attack in tavern, this limit was added for speech sanity (Kain says 'and so I left').

{{finished}}</text>
    </revision>
    <revision>
      <id>3357</id>
      <timestamp>2013-01-16T14:09:14Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3780">{{grammar}}
{{TOCRIGHT}}
This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: Legacy of Kain. All features are added using &quot;extend, not break&quot; paradigm. And all changes are targeted to make better gameplay with new 3D environments. Features that are optional is marked italic. Not all features can be optional however. We are making game, not some kind of constructor.http://omnicide.legacy-of-kain.ru/w/index.php/Main_Page

Features that can't be made optional and prove breakage to game feel, will be removed.

===Graphics===
* ''Modern hud'';
* ''Modern worldmap style'';
* ''Custom or automatic color for magic (automatic is based on biggest sphere was picked up)'';
* ''Subtitles for speech (classic and above-the-head)'';
* ''Subtitles for videos'';
===Sound===
* Different hit sound based on surface type;
* ''New musical themes: extended (new tracks from Bloody Sounds) and modern (new tracks &amp; remixes from Bloody Sounds)'';
* Music are crossfaded between levels. If next level will play same track, music is not restarted.
* ''Footstep sounds'';
* New ambient and combat sounds;
===Gameplay general===
* ''Game speed: normal (PC), fast, faster (Playstation-like)'';
* All melee weapons now using blade path tracing.
* Nosgoth Blood Script can now be translated. This means different languages can have different rune alphabet.
* Some secrets are changed, so needs to be found again;
* Camera is slightly higher than in Blood Omen;
===New abilities based on spell/attack hold delay===
* Autoaim for straightforward spells &amp; artifacts (energy bolt, implode) - 15 degrees around look direction (activated by holding spell more than 1 second);
* Soul Reaver can optionally use normal attack (does slightly more damage than iron sword) if attack is hold less than 0.5 sec;
* Long jump for lupon form (which can get really far) - press jump and move button of current look direction at same time;
* Axes combos now using &quot;rage meter&quot; which grows once player presses attack. To launch &quot;whirlwind&quot; attack player should do 6 or more pressing per second for 2 seconds, by making 2 or more pressing for second, a series of hits combo is launched (can make long series of 20-30 hits);
===Combat changes===
* Sword attacks faster;
* Axes attacks faster;
* Enemies attack faster;
* Flay homing are more smooth, also artifact can miss in some cases (when enemy runs out of flay velocity line and flay speed was too high to correct);
* The chance for &quot;Vae Victis&quot; and Kain's laugh are greatly reduced;
* Slow Time spell now affects all world around Kain, instead of just enemies. This means that missiles are slowed down too, as well as torch flames, rain particles, gravity, everything that is not Kain;
===Captives===
* The chance for &quot;Please help me kind sir&quot; are reduced, speech are only played when Kain is close enough;
===Enemies===
* Throwers do attack at 360 degree (was 8 directions only);
* AI reacts faster, can chase Kain and follow him;
* Melee enemies have better knowledge how to attack player;
* Town characters flee when see Kain;
===Interactivity===
* New marks to observe the world;
* Can break, kick and push environments in houses;
* All puzzles are randomized. Each time you begin game, puzzles you meet (there are not many ot them though) will be different;
* Some of original map downfalls now considered instant death zones - once kain falls to the gulf, it loses one Heart of Darkness and get teleported to safe place;
* Forest are semi-walkable now, allowing to reach new places and secrets;
* Random weather cycle (original one was fixed);
===Prologue changes===
* Kain cannot attack in tavern, this limit was added for speech sanity (Kain says 'and so I left').

{{finished}}</text>
    </revision>
    <revision>
      <id>3580</id>
      <timestamp>2013-02-01T21:42:10Z</timestamp>
      <contributor>
        <ip>95.29.115.197</ip>
      </contributor>
      <text xml:space="preserve" bytes="3725">{{grammar}}
{{TOCRIGHT}}
This page contains a rough gameplay feature list that Blood Omnicide have added or altered in comparison with it's icon - Blood Omen: Legacy of Kain. All features are added using &quot;extend, not break&quot; paradigm. And all changes are targeted to make better gameplay with new 3D environments. Features that are optional is marked italic. Not all features can be optional however. We are making game, not some kind of constructor.

Features that can't be made optional and prove breakage to game feel, will be removed.

===Graphics===
* ''Modern hud'';
* ''Modern worldmap style'';
* ''Custom or automatic color for magic (automatic is based on biggest sphere was picked up)'';
* ''Subtitles for speech (classic and above-the-head)'';
* ''Subtitles for videos'';
===Sound===
* Different hit sound based on surface type;
* ''New musical themes: extended (new tracks from Bloody Sounds) and modern (new tracks &amp; remixes from Bloody Sounds)'';
* Music are crossfaded between levels. If next level will play same track, music is not restarted.
* ''Footstep sounds'';
* New ambient and combat sounds;
===Gameplay general===
* ''Game speed: normal (PC), fast, faster (Playstation-like)'';
* All melee weapons now using blade path tracing.
* Nosgoth Blood Script can now be translated. This means different languages can have different rune alphabet.
* Some secrets are changed, so needs to be found again;
* Camera is slightly higher than in Blood Omen;
===New abilities based on spell/attack hold delay===
* Autoaim for straightforward spells &amp; artifacts (energy bolt, implode) - 15 degrees around look direction (activated by holding spell more than 1 second);
* Soul Reaver can optionally use normal attack (does slightly more damage than iron sword) if attack is hold less than 0.5 sec;
* Long jump for lupon form (which can get really far) - press jump and move button of current look direction at same time;
* Axes combos now using &quot;rage meter&quot; which grows once player presses attack. To launch &quot;whirlwind&quot; attack player should do 6 or more pressing per second for 2 seconds, by making 2 or more pressing for second, a series of hits combo is launched (can make long series of 20-30 hits);
===Combat changes===
* Sword attacks faster;
* Axes attacks faster;
* Enemies attack faster;
* Flay homing are more smooth, also artifact can miss in some cases (when enemy runs out of flay velocity line and flay speed was too high to correct);
* The chance for &quot;Vae Victis&quot; and Kain's laugh are greatly reduced;
* Slow Time spell now affects all world around Kain, instead of just enemies. This means that missiles are slowed down too, as well as torch flames, rain particles, gravity, everything that is not Kain;
===Captives===
* The chance for &quot;Please help me kind sir&quot; are reduced, speech are only played when Kain is close enough;
===Enemies===
* Throwers do attack at 360 degree (was 8 directions only);
* AI reacts faster, can chase Kain and follow him;
* Melee enemies have better knowledge how to attack player;
* Town characters flee when see Kain;
===Interactivity===
* New marks to observe the world;
* Can break, kick and push environments in houses;
* All puzzles are randomized. Each time you begin game, puzzles you meet (there are not many ot them though) will be different;
* Some of original map downfalls now considered instant death zones - once kain falls to the gulf, it loses one Heart of Darkness and get teleported to safe place;
* Forest are semi-walkable now, allowing to reach new places and secrets;
* Random weather cycle (original one was fixed);
===Prologue changes===
* Kain cannot attack in tavern, this limit was added for speech sanity (Kain says 'and so I left').

{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Blood Omnicide goals and features</title>
    <ns>0</ns>
    <id>201</id>
      <sha1>s2hpairfa8daxmc9z9lshubhzt0a177</sha1>
    <revision>
      <id>2356</id>
      <timestamp>2012-08-01T10:23:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{WIP}} Blood Omnicide goal is to provide a faithful high definition versions of original Blood Omen contents including media, gamecode, text and more.  Producing a 3d port of...&quot;</comment>
      <text xml:space="preserve" bytes="1343">{{WIP}}
Blood Omnicide goal is to provide a faithful high definition versions of original Blood Omen contents including media, gamecode, text and more.

Producing a 3d port of Blood Omen effectively breaks into this tasks:

* New gamecode written from scratch
* Make port able to link to original game (catching some of it's resources)
* 3D levels made from scratch
* Retexturing
* Stereonized music (optional)

===General goals===
* Port Blood Omen to 3D
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Fix bugs caused by old technology limitations
* Add optional new features

====Gamecode goals====
* Implement all Blood Omen game mechanics
* Make things extendable
* Evolve original features in the way they was maked by Blood Omen developers

====Level design goals====
* Implement all of original locations
* Add new secrets and a ways to breach into the secret (using new abilities of 3D technology)
* Keep level design as much faithful as possible, while providing a visual quality of locations

====Reexturing goals====
* 8x texture resolution in comparison with original textures (x256 larger textures)
* Keep the original color theme as much as possible (this is tough)

__NOTOC__</text>
    </revision>
    <revision>
      <id>2357</id>
      <timestamp>2012-08-01T10:50:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2055">{{WIP}}
Blood Omnicide is a project to recreate of Blood Omen: Legacy Of Kain in 3D. Project is being builded on a three corner stones:

'''Stone one''': Saving original game feel and providing nearly same gameplay and balance. For sure, there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones should be optional in order to not violate game experience. 

'''Stone two''': SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

'''Stone three''': Blood Omnicide is engine port, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

All three stones make up the project's goals:

* Port Blood Omen to 3D by using original game resources
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Add 3D high definition content
* Fix bugs caused by old technology limitations and evolve original features in the way they was maked by Blood Omen developers
* Add optional new features

==== Gameplay Features ====
* Improved AI
* Improved game dynamics (combat attacks and actions)
* More interactivity (Open Dynamics Engine physics, material system)
* Game stats and achivements
* QuakeC scripting language

==== Level design ====
* All levels made from scratch
* Top-down style of levels
* Most of map events are scripted, not hardcoded (so, could be reused on user-made maps)
* Altered secrets

==== Visuals ====
* Hi-res textures (4x higher than original), new special effects
* Original effects (gore, weather, spells) all reworked and improved
* New 2d graphics for the menu and inventory screen

==== Engine ====
* Multiple languages support (via localization packs)
* Subtitles for speech and video
* Levels in Quake 3 BSP format

__NOTOC__</text>
    </revision>
    <revision>
      <id>2358</id>
      <timestamp>2012-08-01T10:51:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Blood Omnicide Goals]] to [[Blood Omnicide goals and features]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="2055">{{WIP}}
Blood Omnicide is a project to recreate of Blood Omen: Legacy Of Kain in 3D. Project is being builded on a three corner stones:

'''Stone one''': Saving original game feel and providing nearly same gameplay and balance. For sure, there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones should be optional in order to not violate game experience. 

'''Stone two''': SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

'''Stone three''': Blood Omnicide is engine port, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

All three stones make up the project's goals:

* Port Blood Omen to 3D by using original game resources
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Add 3D high definition content
* Fix bugs caused by old technology limitations and evolve original features in the way they was maked by Blood Omen developers
* Add optional new features

==== Gameplay Features ====
* Improved AI
* Improved game dynamics (combat attacks and actions)
* More interactivity (Open Dynamics Engine physics, material system)
* Game stats and achivements
* QuakeC scripting language

==== Level design ====
* All levels made from scratch
* Top-down style of levels
* Most of map events are scripted, not hardcoded (so, could be reused on user-made maps)
* Altered secrets

==== Visuals ====
* Hi-res textures (4x higher than original), new special effects
* Original effects (gore, weather, spells) all reworked and improved
* New 2d graphics for the menu and inventory screen

==== Engine ====
* Multiple languages support (via localization packs)
* Subtitles for speech and video
* Levels in Quake 3 BSP format

__NOTOC__</text>
    </revision>
    <revision>
      <id>2370</id>
      <timestamp>2012-08-01T13:54:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2070">{{unfinished}}
{{WIP}}
Blood Omnicide is a project to recreate of Blood Omen: Legacy Of Kain in 3D. Project is being builded on a three corner stones:

'''Stone one''': Saving original game feel and providing nearly same gameplay and balance. For sure, there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones should be optional in order to not violate game experience. 

'''Stone two''': SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

'''Stone three''': Blood Omnicide is engine port, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

All three stones make up the project's goals:

* Port Blood Omen to 3D by using original game resources
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Add 3D high definition content
* Fix bugs caused by old technology limitations and evolve original features in the way they was maked by Blood Omen developers
* Add optional new features

==== Gameplay Features ====
* Improved AI
* Improved game dynamics (combat attacks and actions)
* More interactivity (Open Dynamics Engine physics, material system)
* Game stats and achivements
* QuakeC scripting language

==== Level design ====
* All levels made from scratch
* Top-down style of levels
* Most of map events are scripted, not hardcoded (so, could be reused on user-made maps)
* Altered secrets

==== Visuals ====
* Hi-res textures (4x higher than original), new special effects
* Original effects (gore, weather, spells) all reworked and improved
* New 2d graphics for the menu and inventory screen

==== Engine ====
* Multiple languages support (via localization packs)
* Subtitles for speech and video
* Levels in Quake 3 BSP format

__NOTOC__</text>
    </revision>
    <revision>
      <id>2714</id>
      <timestamp>2012-10-07T09:48:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Visuals */</comment>
      <text xml:space="preserve" bytes="2070">{{unfinished}}
{{WIP}}
Blood Omnicide is a project to recreate of Blood Omen: Legacy Of Kain in 3D. Project is being builded on a three corner stones:

'''Stone one''': Saving original game feel and providing nearly same gameplay and balance. For sure, there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones should be optional in order to not violate game experience. 

'''Stone two''': SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

'''Stone three''': Blood Omnicide is engine port, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

All three stones make up the project's goals:

* Port Blood Omen to 3D by using original game resources
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Add 3D high definition content
* Fix bugs caused by old technology limitations and evolve original features in the way they was maked by Blood Omen developers
* Add optional new features

==== Gameplay Features ====
* Improved AI
* Improved game dynamics (combat attacks and actions)
* More interactivity (Open Dynamics Engine physics, material system)
* Game stats and achivements
* QuakeC scripting language

==== Level design ====
* All levels made from scratch
* Top-down style of levels
* Most of map events are scripted, not hardcoded (so, could be reused on user-made maps)
* Altered secrets

==== Visuals ====
* Hi-res textures (8x higher than original), new special effects
* Original effects (gore, weather, spells) all reworked and improved
* New 2d graphics for the menu and inventory screen

==== Engine ====
* Multiple languages support (via localization packs)
* Subtitles for speech and video
* Levels in Quake 3 BSP format

__NOTOC__</text>
    </revision>
    <revision>
      <id>2853</id>
      <timestamp>2012-11-22T11:36:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2091">{{unfinished}}
Blood Omnicide is a project to recreate of Blood Omen: Legacy Of Kain in 3D. Project is being builded on a three corner stones:

'''Stone one''': Saving original game feel and providing nearly same gameplay and balance. For sure, there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones should be optional in order to not violate game experience. 

'''Stone two''': SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

'''Stone three''': Blood Omnicide is engine port, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

== The Goals ==

All three stones make up the project's goals:

* Port Blood Omen to 3D by using original game resources
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Add 3D high definition content
* Fix bugs caused by old technology limitations and evolve original features in the way they was maked by Blood Omen developers
* Add optional new features

== Key Features ==

=== Gameplay Features ===
* Improved AI
* Improved game dynamics (combat attacks and actions)
* More interactivity (Open Dynamics Engine physics, material system)
* Game stats and achivements
* QuakeC scripting language

=== Level design ===
* All levels made from scratch
* Top-down style of levels
* Most of map events are scripted, not hardcoded (so, could be reused on user-made maps)
* Altered secrets

=== Visuals ===
* Hi-res textures (8x higher than original), new special effects
* Original effects (gore, weather, spells) all reworked and improved
* New 2d graphics for the menu and inventory screen

=== Engine ===
* Multiple languages support (via localization packs)
* Subtitles for speech and video
* Levels in Quake 3 BSP format

__NOTOC__</text>
    </revision>
    <revision>
      <id>2912</id>
      <timestamp>2012-11-23T03:15:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2091">{{unfinished}}
Blood Omnicide is a project to recreate of Blood Omen: Legacy Of Kain in 3D. Project is being builded on a three corner stones:

'''Stone one''': Saving original game feel and providing nearly same gameplay and balance. For sure, there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones should be optional in order to not violate game experience. 

'''Stone two''': SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

'''Stone three''': Blood Omnicide is engine port, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

== The Goals ==

All three stones make up the project's goals:

* Port Blood Omen to 3D by using original game resources
* Unveil all original resources and formats to be used by community
* Produce a open-source code suitable for modding and level making
* Provide nearly-same color theme and game feel as in original
* Add 3D high definition content
* Fix bugs caused by old technology limitations and evolve original features in the way they was maked by Blood Omen developers
* Add optional new features

== Key features ==

=== Gameplay Features ===
* Improved AI
* Improved game dynamics (combat attacks and actions)
* More interactivity (Open Dynamics Engine physics, material system)
* Game stats and achivements
* QuakeC scripting language

=== Level design ===
* All levels made from scratch
* Top-down style of levels
* Most of map events are scripted, not hardcoded (so, could be reused on user-made maps)
* Altered secrets

=== Visuals ===
* Hi-res textures (8x higher than original), new special effects
* Original effects (gore, weather, spells) all reworked and improved
* New 2d graphics for the menu and inventory screen

=== Engine ===
* Multiple languages support (via localization packs)
* Subtitles for speech and video
* Levels in Quake 3 BSP format

__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Blood Omnicide team</title>
    <ns>0</ns>
    <id>588</id>
      <sha1>68m9lfln2dgvzieyrm8vqqf8ha8550r</sha1>
    <revision>
      <id>3288</id>
      <timestamp>2012-12-02T00:05:01Z</timestamp>
      <contributor>
        <ip>2.94.98.252</ip>
      </contributor>
      <comment>Created page with &quot;1&quot;</comment>
      <text xml:space="preserve" bytes="1">1</text>
    </revision>
    <revision>
      <id>3318</id>
      <timestamp>2012-12-12T23:24:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5858">{{WIP}}
{{TOCRIGHT}}
This article explains some inner workings and rules of Blood Omnicide team.
==The core principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team.
:In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even if on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:''It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.''

'''12. Know whats going on'''
:''It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.''

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3319</id>
      <timestamp>2012-12-12T23:25:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5857">{{WIP}}
{{TOCRIGHT}}
This article explains some inner workings and rules of Blood Omnicide team.
==The core principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even if on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:''It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.''

'''12. Know whats going on'''
:''It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.''

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3320</id>
      <timestamp>2012-12-12T23:37:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5861">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The core principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even if on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:''It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.''

'''12. Know whats going on'''
:''It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.''

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3321</id>
      <timestamp>2012-12-12T23:37:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5856">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even if on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:''It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.''

'''12. Know whats going on'''
:''It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.''

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3322</id>
      <timestamp>2012-12-12T23:39:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5853">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:''It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.''

'''12. Know whats going on'''
:''It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.''

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3323</id>
      <timestamp>2012-12-12T23:39:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5845">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3324</id>
      <timestamp>2012-12-12T23:40:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5942">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:the knowledge of other members work is the key to understanding whats guing on with the project. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3325</id>
      <timestamp>2012-12-12T23:40:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5942">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding whats guing on with the project. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3326</id>
      <timestamp>2012-12-12T23:42:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5987">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3327</id>
      <timestamp>2012-12-12T23:45:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6008">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. Not using 'ripped' content'''
:Blood Omnicide are not using content ripped from the games. Even from Blood Omen.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3328</id>
      <timestamp>2012-12-12T23:57:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6255">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-making is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3329</id>
      <timestamp>2012-12-12T23:58:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6257">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms, etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The Quality of project = quality of it's most weak thing. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3330</id>
      <timestamp>2012-12-13T10:18:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6255">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3331</id>
      <timestamp>2012-12-13T10:21:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6272">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around SVN repository, every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3332</id>
      <timestamp>2012-12-13T11:06:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6297">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around [[Repository Reference|SVN repository]], every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3591</id>
      <timestamp>2013-02-14T17:32:06Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="6297">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around [[Repository Reference|SVN repository]], every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenzo Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3599</id>
      <timestamp>2013-02-17T12:33:43Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="6315">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around [[Repository Reference|SVN repository]], every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenzo Forini (TraductionProduction), Giorgio Di Nucci - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3600</id>
      <timestamp>2013-02-17T21:57:01Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="6325">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around [[Repository Reference|SVN repository]], every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenzo Forini (TraductionProduction), Giorgio 'Zelgius' Di Nucci - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3690</id>
      <timestamp>2014-01-18T12:27:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6420">{{WIP}}
{{TOCRIGHT}}
This article explains rules and principles Blood Omnicide team is built around.
==The principles==

=====Why participate?=====
:Blood Omnicide team is formed solely to provide Blood Omnicide development. There can be different personal meanings of joining and contributing, but it must match the goal - develop Blood Omnicide with best quality possible.

=====Core team calls the shots=====
:For a community-driven project, such as Blood Omnicide, everyone constantly joining or leaving team.
:In order to keep things clear, there is 'core' team which consist of most passionate members doing planning, decision making and long-term support, and 'cover' team focusing on short-term support.

=====Cover matters=====
:It is easy to assume that people forming 'core' team are the team because they are more visible than other members. Core team members is more skilled, passionate and have better knowledge, but there will be no real benefit of that skills without cover team. In other words, a three-man group cant significantly push the project's progress not matter how skilled they are.

=====Internationale=====
:Blood Omnicide team consists of people living in different countries. Because of that, there can be very little communication between team members. In order to keep things synced, all workflow information is centered around [[Repository Reference|SVN repository]], every change leads to commit and any team member can inspect the results of other members work. Working copy is primary source of inspiration and 'what is going on' information.

=====Evolving from niche thing towards common thing=====
:Blood Omnicide at its goal going to be a niche thing. Meanwhile, changes that helps to bring it to more wide auditory is accepted, unless they confront with faithfulness. An example of good changes: multilingual support, wide range of supported platforms etc.

==The team codex==

'''1. Extend, not replace'''
:Blood Omnicide is a project to port Blood Omen to 3D. Additions should be keeped at minimum, faithfulness and respect to original at maximum. If thing is working all-right, it doesnt need to be changed.
:The only exception is 2d-&gt;3d transition and evolve principle, which is allowed to change gameplay in order to get best play experience.

'''2. A careful re-make'''
:Porting to 3D involves re-making of many things using new scripts and techonogies. The key principle of faithful re-creation is to carefully inspect the original thing, find the rules it was built around. The rules may be (but not limited to): balance, proportions, colors, inspiration, imagery and connections with the rest of game world.

'''3. Concentrate on a most weak things'''
:The quality of project = quality of it's most weak part. In order to get maximum progress, weakest things are best candidates to be worked on.

'''4. Continue improvements, even on very little details'''
:Details is a key to quality. And its always good to add more depth and reduce unneeded complexity.

'''5. Document changes. Fill the commit logs'''
:It helps other members to understand direction project is moving to.

'''6. Break big tasks to a small ones'''
:Finishing up small parts is easier and more controllable.

'''7. Follow the plan'''
:Dont start a work if you have no plan and full vision of a thing.

'''8. Be opened for collaboration'''
:Be opened for assistance other members can offer.

'''9. Conduct and fill up the list of offers and bugs'''
:Almost any thing made have its good and bad sides. Conducting the opinions of others helps to get cleaner vision.

'''10. If you dont know how to make something - ask other members'''
:One of particular benefits of planning is that you come to knowledge, what you will need to get thing finished, and particularily, a things you will need to learn in order to follow the plan. 
:Not all kinds of information could be formalized and documented. And its likely that some part of current project information is not documented at all. So it is always good to communicate with others to get better knowledge.'''

'''11. Criticize, if you can make better'''
:It is not bad to criticize the work, but it should have a valid point-of-view as a ground. Criticism without particular explanation is not helpful.

'''12. Know whats going on'''
:The knowledge of other members work is the key to understanding what is going with the project and therefore, using optimal way to do things. It is best if any team member knows what is happened. Communicating with other members, reading commit logs and checking out wiki page changes are good way to stay on the edge.

==Team credits==

This is rough functional team credits listing. A full version will be available at release.

===The core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===3d modelling===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===General artwork and concept art===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Sketches/concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Bloody Sounds project===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Translation packs support team===
* Lorenzo Forini (TraductionProduction), Giorgio 'Zelgius' Di Nucci - Italian pack
* Marcin Szymczak - Polish pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian pack
* Vitor Bolonhesi Gracia, Cristopher Polzl - Brazilian portuguese pack
* Janos Birinyi - Hungarian pack
* Alfonso Ruzafa - Spanish pack
* Xavier 'Knilf' Hurteau - French pack

===Gameplay inspection===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Additional texturing / art credits===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Game engine and tools===
* [[Darkplaces engine|Darkplaces engine]] team and contributors
* Randy 'Ydnar' Reddig and Q3map2 contributors
* GtkRadiant team and contributors
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Blood Pill</title>
    <ns>0</ns>
    <id>303</id>
      <sha1>mjhmm0964d8v9urp7e1p9ao6m8kmcmq</sha1>
    <revision>
      <id>2834</id>
      <timestamp>2012-11-22T06:55:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{finished}} {{grammar}} [[File:Bloodpill.png|thumb|right|400px]] Blood Pill - a set of tools to manipulate with .BIG files. It can be used to view the data stored in '''pill....&quot;</comment>
      <text xml:space="preserve" bytes="3689">{{finished}}
{{grammar}}
[[File:Bloodpill.png|thumb|right|400px]]
Blood Pill - a set of tools to manipulate with .BIG files. It can be used to view the data stored in '''pill.big''' - resources file of Blood Omen. Blood Pill is able to decode into readable format all filetypes used in the game: speech sound, tile, sprite, tim graphich and more. Only Blood Omen .BIG files are supported.

===Features===

* Packing/Unpacking of .BIG files for PC and PSX versions of BO
* TIM &lt;-&gt; TGA autoconversion during packing and unpacking
* RAW ADPCMWAV/OGG autoconversion during packing and unpacking
* Unpacking sprites (enemies and objects) to separate TGA pictures
* Unpacking tiles (level textures) to TGA
* Unpacking the multiobject files ('merged' files that is used on some entries in BO)
* .JAM video to .TGA decoding
* Decoding VAG files to WAV PCM/OGG sounds
* Decoding levels to TGA images (with optional developer info shown)
* Patching .big files
* Providing support for Blood Omnicide installation

===Usage===

Blood Pill is a commandline utility. To get available command list, execute it without any parms. Also there is some sample .bat files in samples/ folder, covering most useful stuff:

* extract_file.bat : unpacks one file from pill.big.
* list.bat : create a listing file from pill.big
* unpack.bat : unpack pill.big with all conversions enabled.
* unpack_raw.bat : unpack pill.big with pure filetypes (no conversions).
* unpack_fortranslating.bat : unpack with TIM-&gt;TGA and ADPCM-&gt;WAV conversion which is useful for making your own BO PC localization.
* unpack_oggsounds.bat : unpack pill.big with all conversions and sound files being converted to Ogg Vorbis.
* pack.bat : create a new pill2.big based on 'bigfile' folder (converts back all tga and wav).
* tga2tim(test.tga).bat : TGA-&gt;TIM conversion
* tim2tga(test.tim).bat : TIM-&gt;TGA conversion
* tim2tga(test.tim)_16to24.bat : TIM-&gt;TGA conversion with 16-&gt;24 bits conversion enabled

To use sample bat files copy them to directory that contains bpill.exe (pill.big should be there too).

==Gallery==
====Unpacked sprites and tiles====
&lt;gallery&gt;
File:bloodpilltiles.jpg
File:bloodpillsprites.jpg
File:bloodpillsprites2.jpg
&lt;/gallery&gt;

====JAM decoded frames====
&lt;gallery&gt;
File:jam1.png
File:jam2.png
File:jam3.png
File:jam4.png
File:jam5.png
File:jam6.png
&lt;/gallery&gt;

====Blood Omen maps converted to TGA====
{|
| valign=top align=center | [[File:bomap1.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap1.jpg]]
| valign=top align=center | [[File:bomap2.jpg|198px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap2.jpg]]
| valign=top align=center | [[File:bomap3.jpg|238px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap3.jpg]]
| valign=top align=center | [[File:bomap4.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap4.jpg]]
|-
| valign=top align=center | [[File:bomap5.jpg|227px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap5.jpg]]
| valign=top align=center | [[File:bomap6.jpg|129px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap6.jpg]]
| valign=top align=center | [[File:bomap7.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap7.jpg]]
| valign=top align=center | [[File:bomap8.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap8.jpg]]
|}
==Download==
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.01.zip Blood Pill v1.01]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.0.zip Blood Pill v1.00]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_0.9.zip Blood Pill v0.9]

==See also==
* [[Blood Omen file formats]]

[[Category:Tools]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2835</id>
      <timestamp>2012-11-22T06:57:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3777">{{finished}}
{{grammar}}
[[File:Bloodpill.png|thumb|right|400px]]
Blood Pill - a set of tools to manipulate with .BIG files. It can be used to view the data stored in '''pill.big''' - resources file of Blood Omen. Blood Pill is able to decode into readable format all filetypes used in the game: speech sound, tile, sprite, tim graphich and more. Only Blood Omen .BIG files are supported.

===Features===

* Packing/Unpacking of .BIG files for PC and PSX versions of BO
* TIM &lt;-&gt; TGA autoconversion during packing and unpacking
* RAW ADPCMWAV/OGG autoconversion during packing and unpacking
* Unpacking sprites (enemies and objects) to separate TGA pictures
* Unpacking tiles (level textures) to TGA
* Unpacking the multiobject files ('merged' files that is used on some entries in BO)
* .JAM video to .TGA decoding
* Decoding VAG files to WAV PCM/OGG sounds
* Decoding levels to TGA images (with optional developer info shown)
* Patching .big files
* Providing support for Blood Omnicide installation

===Usage===

Blood Pill is a commandline utility. To get available command list, execute it without any parms. Also there is some sample batch scripts in samples/ folder, covering most useful stuff:

Sample batch scripts:

* '''extract_file.bat''' : unpacks one file from pill.big.
* '''list.bat''' : create a listing file from pill.big
* '''unpack.bat''' : unpack pill.big with all conversions enabled.
* '''unpack_raw.bat''' : unpack pill.big with pure filetypes (no conversions).
* '''unpack_fortranslating.bat''' : unpack with TIM-&gt;TGA and ADPCM-&gt;WAV conversion which is useful for making your own BO PC translation.
* '''unpack_oggsounds.bat''' : unpack pill.big with all conversions and sound files being converted to Ogg Vorbis.
* '''pack.bat''' : create a new pill2.big based on 'bigfile' folder (converts back all tga and wav).
* '''tga2tim(test.tga).bat''' : TGA-&gt;TIM conversion
* '''tim2tga(test.tim).bat''' : TIM-&gt;TGA conversion
* '''tim2tga(test.tim)_16to24.bat''' : TIM-&gt;TGA conversion with 16-&gt;24 bits conversion enabled

To use sample batch files. copy them to directory that contains bpill.exe (pill.big should be there too).

==Gallery==
====Unpacked sprites and tiles====
&lt;gallery&gt;
File:bloodpilltiles.jpg
File:bloodpillsprites.jpg
File:bloodpillsprites2.jpg
&lt;/gallery&gt;

====JAM decoded frames====
&lt;gallery&gt;
File:jam1.png
File:jam2.png
File:jam3.png
File:jam4.png
File:jam5.png
File:jam6.png
&lt;/gallery&gt;

====Blood Omen maps converted to TGA====
{|
| valign=top align=center | [[File:bomap1.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap1.jpg]]
| valign=top align=center | [[File:bomap2.jpg|198px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap2.jpg]]
| valign=top align=center | [[File:bomap3.jpg|238px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap3.jpg]]
| valign=top align=center | [[File:bomap4.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap4.jpg]]
|-
| valign=top align=center | [[File:bomap5.jpg|227px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap5.jpg]]
| valign=top align=center | [[File:bomap6.jpg|129px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap6.jpg]]
| valign=top align=center | [[File:bomap7.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap7.jpg]]
| valign=top align=center | [[File:bomap8.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap8.jpg]]
|}
==Download==
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.01.zip Blood Pill v1.01]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.0.zip Blood Pill v1.00]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_0.9.zip Blood Pill v0.9]

==See also==
* [[Blood Omen file formats]]

[[Category:Tools]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2836</id>
      <timestamp>2012-11-22T06:57:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3787">{{finished}}
{{grammar}}
[[File:Bloodpill.png|thumb|right|400px]]
Blood Pill - a set of tools to manipulate with .BIG files. It can be used to view the data stored in '''pill.big''' - resources file of Blood Omen.

Blood Pill is able to decode all filetypes used in the game into readable/listenable form: speech sound, tile, sprite, tim graphich and more. Only Blood Omen .BIG files are supported.

===Features===

* Packing/Unpacking of .BIG files for PC and PSX versions of BO
* TIM &lt;-&gt; TGA autoconversion during packing and unpacking
* RAW ADPCMWAV/OGG autoconversion during packing and unpacking
* Unpacking sprites (enemies and objects) to separate TGA pictures
* Unpacking tiles (level textures) to TGA
* Unpacking the multiobject files ('merged' files that is used on some entries in BO)
* .JAM video to .TGA decoding
* Decoding VAG files to WAV PCM/OGG sounds
* Decoding levels to TGA images (with optional developer info shown)
* Patching .big files
* Providing support for Blood Omnicide installation

===Usage===

Blood Pill is a commandline utility. To get available command list, execute it without any parms. Also there is some sample batch scripts in samples/ folder, covering most useful stuff:

Sample batch scripts:

* '''extract_file.bat''' : unpacks one file from pill.big.
* '''list.bat''' : create a listing file from pill.big
* '''unpack.bat''' : unpack pill.big with all conversions enabled.
* '''unpack_raw.bat''' : unpack pill.big with pure filetypes (no conversions).
* '''unpack_fortranslating.bat''' : unpack with TIM-&gt;TGA and ADPCM-&gt;WAV conversion which is useful for making your own BO PC translation.
* '''unpack_oggsounds.bat''' : unpack pill.big with all conversions and sound files being converted to Ogg Vorbis.
* '''pack.bat''' : create a new pill2.big based on 'bigfile' folder (converts back all tga and wav).
* '''tga2tim(test.tga).bat''' : TGA-&gt;TIM conversion
* '''tim2tga(test.tim).bat''' : TIM-&gt;TGA conversion
* '''tim2tga(test.tim)_16to24.bat''' : TIM-&gt;TGA conversion with 16-&gt;24 bits conversion enabled

To use sample batch files. copy them to directory that contains bpill.exe (pill.big should be there too).

==Gallery==
====Unpacked sprites and tiles====
&lt;gallery&gt;
File:bloodpilltiles.jpg
File:bloodpillsprites.jpg
File:bloodpillsprites2.jpg
&lt;/gallery&gt;

====JAM decoded frames====
&lt;gallery&gt;
File:jam1.png
File:jam2.png
File:jam3.png
File:jam4.png
File:jam5.png
File:jam6.png
&lt;/gallery&gt;

====Blood Omen maps converted to TGA====
{|
| valign=top align=center | [[File:bomap1.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap1.jpg]]
| valign=top align=center | [[File:bomap2.jpg|198px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap2.jpg]]
| valign=top align=center | [[File:bomap3.jpg|238px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap3.jpg]]
| valign=top align=center | [[File:bomap4.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap4.jpg]]
|-
| valign=top align=center | [[File:bomap5.jpg|227px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap5.jpg]]
| valign=top align=center | [[File:bomap6.jpg|129px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap6.jpg]]
| valign=top align=center | [[File:bomap7.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap7.jpg]]
| valign=top align=center | [[File:bomap8.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap8.jpg]]
|}
==Download==
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.01.zip Blood Pill v1.01]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.0.zip Blood Pill v1.00]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_0.9.zip Blood Pill v0.9]

==See also==
* [[Blood Omen file formats]]

[[Category:Tools]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3670</id>
      <timestamp>2013-09-30T07:42:22Z</timestamp>
      <contributor>
        <ip>77.239.253.111</ip>
      </contributor>
      <comment>/* Download */</comment>
      <text xml:space="preserve" bytes="3849">{{finished}}
{{grammar}}
[[File:Bloodpill.png|thumb|right|400px]]
Blood Pill - a set of tools to manipulate with .BIG files. It can be used to view the data stored in '''pill.big''' - resources file of Blood Omen.

Blood Pill is able to decode all filetypes used in the game into readable/listenable form: speech sound, tile, sprite, tim graphich and more. Only Blood Omen .BIG files are supported.

===Features===

* Packing/Unpacking of .BIG files for PC and PSX versions of BO
* TIM &lt;-&gt; TGA autoconversion during packing and unpacking
* RAW ADPCMWAV/OGG autoconversion during packing and unpacking
* Unpacking sprites (enemies and objects) to separate TGA pictures
* Unpacking tiles (level textures) to TGA
* Unpacking the multiobject files ('merged' files that is used on some entries in BO)
* .JAM video to .TGA decoding
* Decoding VAG files to WAV PCM/OGG sounds
* Decoding levels to TGA images (with optional developer info shown)
* Patching .big files
* Providing support for Blood Omnicide installation

===Usage===

Blood Pill is a commandline utility. To get available command list, execute it without any parms. Also there is some sample batch scripts in samples/ folder, covering most useful stuff:

Sample batch scripts:

* '''extract_file.bat''' : unpacks one file from pill.big.
* '''list.bat''' : create a listing file from pill.big
* '''unpack.bat''' : unpack pill.big with all conversions enabled.
* '''unpack_raw.bat''' : unpack pill.big with pure filetypes (no conversions).
* '''unpack_fortranslating.bat''' : unpack with TIM-&gt;TGA and ADPCM-&gt;WAV conversion which is useful for making your own BO PC translation.
* '''unpack_oggsounds.bat''' : unpack pill.big with all conversions and sound files being converted to Ogg Vorbis.
* '''pack.bat''' : create a new pill2.big based on 'bigfile' folder (converts back all tga and wav).
* '''tga2tim(test.tga).bat''' : TGA-&gt;TIM conversion
* '''tim2tga(test.tim).bat''' : TIM-&gt;TGA conversion
* '''tim2tga(test.tim)_16to24.bat''' : TIM-&gt;TGA conversion with 16-&gt;24 bits conversion enabled

To use sample batch files. copy them to directory that contains bpill.exe (pill.big should be there too).

==Gallery==
====Unpacked sprites and tiles====
&lt;gallery&gt;
File:bloodpilltiles.jpg
File:bloodpillsprites.jpg
File:bloodpillsprites2.jpg
&lt;/gallery&gt;

====JAM decoded frames====
&lt;gallery&gt;
File:jam1.png
File:jam2.png
File:jam3.png
File:jam4.png
File:jam5.png
File:jam6.png
&lt;/gallery&gt;

====Blood Omen maps converted to TGA====
{|
| valign=top align=center | [[File:bomap1.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap1.jpg]]
| valign=top align=center | [[File:bomap2.jpg|198px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap2.jpg]]
| valign=top align=center | [[File:bomap3.jpg|238px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap3.jpg]]
| valign=top align=center | [[File:bomap4.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap4.jpg]]
|-
| valign=top align=center | [[File:bomap5.jpg|227px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap5.jpg]]
| valign=top align=center | [[File:bomap6.jpg|129px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap6.jpg]]
| valign=top align=center | [[File:bomap7.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap7.jpg]]
| valign=top align=center | [[File:bomap8.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap8.jpg]]
|}
==Download==
* [https://github.com/paulvortex/BloodPill GitHub repository]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.01.zip Blood Pill v1.01]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.0.zip Blood Pill v1.00]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_0.9.zip Blood Pill v0.9]

==See also==
* [[Blood Omen file formats]]

[[Category:Tools]]
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:About</title>
    <ns>4</ns>
    <id>162</id>
      <sha1>6za6z27cqk2qatlebqsiz85czbjf3rd</sha1>
    <revision>
      <id>1988</id>
      <timestamp>2012-07-27T13:20:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;-&quot;</comment>
      <text xml:space="preserve" bytes="1">-</text>
    </revision>
    <revision>
      <id>1990</id>
      <timestamp>2012-07-27T13:30:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="720">Blood Omnicide Wiki is site build for us, developers of the project and for all users who want to help with development of Blood Omnicide or make mods or new levels for Blood Omnicide.

This site hopefully contain:

* Most full information about Blood Omnicide development
* Many pieces of information about development on Darkplaces engine
* A discussion platform on which users cover ideas related to project's development and Darkplaces engine
* Spoilers, cheat codes

==Contributing==
Before add or modify articles please check out [[BloodWiki:community portal | Community Portal]]

==Terms of Use==
For complete information about using Blood Omnicide Wiki please refere to [[BloodWiki:Terms of use | Terms of use]].</text>
    </revision>
    <revision>
      <id>1991</id>
      <timestamp>2012-07-27T13:31:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="777">{{DISPLAYTITLE:About BloodWiki}}
{{article unfinished}}

Blood Omnicide Wiki is site build for us, developers of the project and for all users who want to help with development of Blood Omnicide or make mods or new levels for Blood Omnicide.

This site hopefully contain:

* Most full information about Blood Omnicide development
* Many pieces of information about development on Darkplaces engine
* A discussion platform on which users cover ideas related to project's development and Darkplaces engine
* Spoilers, cheat codes

==Contributing==
Before add or modify articles please check out [[BloodWiki:community portal | Community Portal]]

==Terms of Use==
For complete information about using Blood Omnicide Wiki please refere to [[BloodWiki:Terms of use | Terms of use]].</text>
    </revision>
    <revision>
      <id>1992</id>
      <timestamp>2012-07-27T13:32:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="787">{{DISPLAYTITLE:About BloodWiki}}
{{article unfinished}}

Blood Omnicide Wiki is site build for us, developers of the Blood Omnicide and for all users who want to help with development of Blood Omnicide or make mods, ports or new levels for Blood Omen.

This site hopefully contain:

* Most full information about Blood Omnicide development
* Many pieces of information about development on Darkplaces engine
* A discussion platform on which users cover ideas related to project's development and Darkplaces engine
* Spoilers, cheat codes

==Contributing==
Before add or modify articles please check out [[BloodWiki:community portal | Community Portal]]

==Terms of Use==
For complete information about using Blood Omnicide Wiki please refere to [[BloodWiki:Terms of use | Terms of use]].</text>
    </revision>
    <revision>
      <id>1997</id>
      <timestamp>2012-07-27T14:00:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="779">{{DISPLAYTITLE:About BloodWiki}}
{{unfinished}}

Blood Omnicide Wiki is site build for us, developers of the Blood Omnicide and for all users who want to help with development of Blood Omnicide or make mods, ports or new levels for Blood Omen.

This site hopefully contain:

* Most full information about Blood Omnicide development
* Many pieces of information about development on Darkplaces engine
* A discussion platform on which users cover ideas related to project's development and Darkplaces engine
* Spoilers, cheat codes

==Contributing==
Before add or modify articles please check out [[BloodWiki:community portal | Community Portal]]

==Terms of Use==
For complete information about using Blood Omnicide Wiki please refere to [[BloodWiki:Terms of use | Terms of use]].</text>
    </revision>
    <revision>
      <id>2034</id>
      <timestamp>2012-07-27T14:57:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="783">{{DISPLAYTITLE:About BloodWiki}}
{{unfinished}}

Blood Omnicide Wiki is site build for us, developers of the Blood Omnicide and for all users who want to help with development of Blood Omnicide or make mods, ports or new levels for Blood Omen.

This site hopefully contain:

* Most full information about Blood Omnicide development
* Many pieces of information about development on [[Darkplaces engine]]
* A discussion platform on which users cover ideas related to project's development and Darkplaces engine
* Spoilers, cheat codes

==Contributing==
Before add or modify articles please check out [[BloodWiki:community portal | Community Portal]]

==Terms of Use==
For complete information about using Blood Omnicide Wiki please refere to [[BloodWiki:Terms of use | Terms of use]].</text>
    </revision>
    <revision>
      <id>2035</id>
      <timestamp>2012-07-27T14:57:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="761">{{DISPLAYTITLE:About BloodWiki}}
{{unfinished}}

Blood Omnicide Wiki is site build for us, developers of the Blood Omnicide and for all users who want to help with development of Blood Omnicide or make mods, ports or new levels for Blood Omen.

This site hopefully contain:

* Most full information about Blood Omnicide development
* Many pieces of information about development on [[Darkplaces engine]]
* A discussion platform on which users cover ideas related to project's development
* Spoilers, cheat codes

==Contributing==
Before add or modify articles please check out [[BloodWiki:community portal | Community Portal]]

==Terms of Use==
For complete information about using Blood Omnicide Wiki please refere to [[BloodWiki:Terms of use | Terms of use]].</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:Community portal</title>
    <ns>4</ns>
    <id>51</id>
      <sha1>i8t1yd0zp5q6ayri1sev4kftsbvkj4v</sha1>
    <revision>
      <id>428</id>
      <timestamp>2012-07-14T19:45:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;[[BloodWiki:Templates]]&quot;</comment>
      <text xml:space="preserve" bytes="23">[[BloodWiki:Templates]]</text>
    </revision>
    <revision>
      <id>443</id>
      <timestamp>2012-07-14T19:53:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="34">[[Category:Templates | Templates]]</text>
    </revision>
    <revision>
      <id>444</id>
      <timestamp>2012-07-14T19:53:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="24">[[[Category:Templates]]]</text>
    </revision>
    <revision>
      <id>445</id>
      <timestamp>2012-07-14T19:55:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="82">[[[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates | Templates]]]</text>
    </revision>
    <revision>
      <id>488</id>
      <timestamp>2012-07-14T22:21:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="78">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates | Templates]</text>
    </revision>
    <revision>
      <id>489</id>
      <timestamp>2012-07-14T22:21:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="76">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates|Templates]</text>
    </revision>
    <revision>
      <id>490</id>
      <timestamp>2012-07-14T22:22:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="76">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>504</id>
      <timestamp>2012-07-14T22:49:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="102">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

[[File:PageAncient.png]]</text>
    </revision>
    <revision>
      <id>505</id>
      <timestamp>2012-07-14T22:51:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="121">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

[[File:PageAncient.png]]

{{hidden|super!}}</text>
    </revision>
    <revision>
      <id>526</id>
      <timestamp>2012-07-14T23:06:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="295">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

[[File:PageAncient.png]]

{{hidden|super!}}












&lt;div class=&quot;NavFrame collapsed&quot;&gt;
  &lt;div class=&quot;NavHead&quot;&gt;Свёрнутый&lt;/div&gt;
  &lt;div class=&quot;NavContent&quot;&gt;
     по умолчанию блок
  &lt;/div&gt;
&lt;/div&gt;</text>
    </revision>
    <revision>
      <id>527</id>
      <timestamp>2012-07-14T23:07:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="248">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]










&lt;div class=&quot;NavFrame collapsed&quot;&gt;
  &lt;div class=&quot;NavHead&quot;&gt;Свёрнутый&lt;/div&gt;
  &lt;div class=&quot;NavContent&quot;&gt;
     по умолчанию блок
  &lt;/div&gt;
&lt;/div&gt;</text>
    </revision>
    <revision>
      <id>528</id>
      <timestamp>2012-07-14T23:08:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="235">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]










&lt;div class=&quot;NavFrame collapsed&quot;&gt;
&lt;div class=&quot;NavHead&quot;&gt;Свёрнутый&lt;/div&gt;
&lt;div class=&quot;NavContent&quot;&gt;по умолчанию блок&lt;/div&gt;
&lt;/div&gt;</text>
    </revision>
    <revision>
      <id>529</id>
      <timestamp>2012-07-14T23:08:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="224">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]


&lt;div class=&quot;NavFrame collapsed&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;Свёрнутый&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;по умолчанию блок&lt;/div&gt;&lt;/div&gt;</text>
    </revision>
    <revision>
      <id>534</id>
      <timestamp>2012-07-14T23:21:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="76">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>538</id>
      <timestamp>2012-07-14T23:26:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="97">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]


{{Hidden | 1 | 2}}</text>
    </revision>
    <revision>
      <id>539</id>
      <timestamp>2012-07-14T23:26:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="116">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]


{{Hidden | Parameter1 | Parameter2 }}</text>
    </revision>
    <revision>
      <id>542</id>
      <timestamp>2012-07-14T23:29:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="116">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

{{Hidden Begin | 1 }}
2
{{Hidden End}}</text>
    </revision>
    <revision>
      <id>543</id>
      <timestamp>2012-07-14T23:30:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="125">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

{{Hidden Begin | Super! }}
Duper
{{Hidden End}}</text>
    </revision>
    <revision>
      <id>554</id>
      <timestamp>2012-07-14T23:39:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="125">[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

{{hidden begin | Super! }}
Duper
{{hidden end}}</text>
    </revision>
    <revision>
      <id>557</id>
      <timestamp>2012-07-14T23:44:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="254">== Special pages ==
[http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]
[http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.css Common.css]
[http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.js Common.js]</text>
    </revision>
    <revision>
      <id>558</id>
      <timestamp>2012-07-14T23:45:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="260">== Special pages ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.css Common.css]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.js Common.js]</text>
    </revision>
    <revision>
      <id>559</id>
      <timestamp>2012-07-14T23:45:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="267">== Templates management ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.css Common.css]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.js Common.js]</text>
    </revision>
    <revision>
      <id>561</id>
      <timestamp>2012-07-14T23:46:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="320">{{hidden begin | Caption }}
Contents
{{hidden end}}

== Templates management ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.css Common.css]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.js Common.js]</text>
    </revision>
    <revision>
      <id>577</id>
      <timestamp>2012-07-15T00:02:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="269">

== Templates management ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.css Common.css]
* [http://omnicide.legacy-of-kain.ru/w/index.php/MediaWiki:Common.js Common.js]</text>
    </revision>
    <revision>
      <id>593</id>
      <timestamp>2012-07-15T00:11:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Templates management */</comment>
      <text xml:space="preserve" bytes="107">

== Templates management ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>654</id>
      <timestamp>2012-07-15T01:40:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="381">

== Categories ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_outdated Outdated articles]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_unfinished Unfinished articles]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_ancient Ancient articles]</text>
    </revision>
    <revision>
      <id>702</id>
      <timestamp>2012-07-15T02:11:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="380">

== Helper pages ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

== Flagged articles --
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_outdated Outdated]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_unfinished Unfinished]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_ancient Ancient]</text>
    </revision>
    <revision>
      <id>703</id>
      <timestamp>2012-07-15T02:11:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="334">

== Helper pages ==
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]

== Flagged articles --
* [Category:Article_outdated Outdated]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_unfinished Unfinished]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_ancient Ancient]</text>
    </revision>
    <revision>
      <id>704</id>
      <timestamp>2012-07-15T02:12:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="354">{{article unfinished}}

= Flagged articles =
* [[Category:Article_outdated Outdated]]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_unfinished Unfinished]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_ancient Ancient]

= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>705</id>
      <timestamp>2012-07-15T02:12:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="355">{{article unfinished}}

= Flagged articles =
* [[:Category:Article_outdated Outdated]]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_unfinished Unfinished]
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Article_ancient Ancient]

= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>706</id>
      <timestamp>2012-07-15T02:13:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="303">{{article unfinished}}

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancien | Ancient articles]]

= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>707</id>
      <timestamp>2012-07-15T02:13:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="304">{{article unfinished}}

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]

= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>708</id>
      <timestamp>2012-07-15T02:14:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="350">{{article unfinished}}

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]




= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>709</id>
      <timestamp>2012-07-15T02:15:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="383">{{article unfinished}}

= ToDo =
* Fill up all base pages

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]


= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>710</id>
      <timestamp>2012-07-15T02:15:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="384">{{article unfinished}}

= ToDo =
* Fill up all base pages


= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]


= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>711</id>
      <timestamp>2012-07-15T02:15:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="382">{{article unfinished}}

= ToDo =
* Fill up all base pages

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

= Helper pages =
* [http://omnicide.legacy-of-kain.ru/w/index.php/Category:Templates Templates]</text>
    </revision>
    <revision>
      <id>714</id>
      <timestamp>2012-07-15T02:17:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="339">{{article unfinished}}

= ToDo =
* Fill up all base pages

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

= Helper pages =
* [:Category:Templates | Templates]</text>
    </revision>
    <revision>
      <id>715</id>
      <timestamp>2012-07-15T02:17:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="341">{{article unfinished}}

= ToDo =
* Fill up all base pages

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

= Helper pages =
* [[:Category:Templates | Templates]]</text>
    </revision>
    <revision>
      <id>760</id>
      <timestamp>2012-07-16T07:51:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>uirks</comment>
      <text xml:space="preserve" bytes="746">{{article unfinished}}

= Guide =
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn [[:Category:Templates | Templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Do [[not]] [[make]] too [[many]] links. It looks bad.

= ToDo =
* Fill up all base pages

= Flagged categories =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

= Helper pages =</text>
    </revision>
    <revision>
      <id>761</id>
      <timestamp>2012-07-16T07:52:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="679">= Guide =
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | Templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Do [[not]] [[make]] too [[many]] links. It looks bad.

= Helper pages =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]</text>
    </revision>
    <revision>
      <id>767</id>
      <timestamp>2012-07-16T08:04:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="679">= Guide =
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Do [[not]] [[make]] too [[many]] links. It looks bad.

= Helper pages =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]</text>
    </revision>
    <revision>
      <id>773</id>
      <timestamp>2012-07-16T08:08:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="687">= Guide =
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

= Helper pages =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]</text>
    </revision>
    <revision>
      <id>966</id>
      <timestamp>2012-07-16T21:19:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="732">= Guide =
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Add 'See also'.
* Dont double-link things.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

= Helper pages =
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]</text>
    </revision>
    <revision>
      <id>1039</id>
      <timestamp>2012-07-17T20:28:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="736">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Add 'See also'.
* Dont double-link things.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]</text>
    </revision>
    <revision>
      <id>1235</id>
      <timestamp>2012-07-18T10:40:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="817">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Add 'See also'.
* Dont double-link things.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

== Want page list ==
Enter here a pages you want to see created at first place.</text>
    </revision>
    <revision>
      <id>1757</id>
      <timestamp>2012-07-24T09:31:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="815">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Hide large technical info in hidden blocks to make articles simple.
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Add 'See also'.
* Dont double-link things.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

== Want page list ==
Add here a pages you want to see created at first place.</text>
    </revision>
    <revision>
      <id>1774</id>
      <timestamp>2012-07-24T12:28:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="745">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Add 'See also'.
* Dont double-link things.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

== Want page list ==
Add here a pages you want to see created at first place.</text>
    </revision>
    <revision>
      <id>1775</id>
      <timestamp>2012-07-24T12:28:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="727">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[not]] [[make]] too [[many]] links. It [[looks]] [[bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

== Want page list ==
Add here a pages you want to see created at first place.</text>
    </revision>
    <revision>
      <id>1905</id>
      <timestamp>2012-07-27T09:22:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="872">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[BloodWiki:Community_portal | not]] [[BloodWiki:Community_portal | make]] too [[BloodWiki:Community_portal | many]] links. It [[BloodWiki:Community_portal | looks]] [[BloodWiki:Community_portal | bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

== Want page list ==
Add here a pages you want to see created at first place.</text>
    </revision>
    <revision>
      <id>1906</id>
      <timestamp>2012-07-27T09:22:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="842">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

== Helper pages ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_ancient | Ancient articles]]
* [[Special:SpecialPages | Special pages]]

== Want page list ==
Add here a pages you want to see created at first place.</text>
    </revision>
    <revision>
      <id>1908</id>
      <timestamp>2012-07-27T09:28:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="976">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

== Pages ToDo  ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]
* [[Special:SpecialPages | All Special pages]]

== Other page categories ==
* [[:Category:Article_wip | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

== Want articles list ==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>1914</id>
      <timestamp>2012-07-27T09:45:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="976">== Guide ==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and [[:Category:Templates | templates]].
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

== Pages ToDo  ==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]
* [[Special:SpecialPages | All Special pages]]

== Other page categories ==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

== Want articles list ==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>1923</id>
      <timestamp>2012-07-27T09:56:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1170">==Guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Article_flags | Article flags]]
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Noticing_templates | Noticing templates]]
* [[:Category:Entity_templates | Entity templates]]

==Pages ToDo==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]
* [[Special:SpecialPages | All Special pages]]

==Other page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Want articles list==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>1924</id>
      <timestamp>2012-07-27T09:57:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1176">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Article_flags | Article flags]]
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Noticing_templates | Noticing templates]]
* [[:Category:Entity_templates | Entity templates]]

==Pages ToDo==
* [[:Category:Article_outdated | Outdated articles]]
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]
* [[Special:SpecialPages | All Special pages]]

==Other page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Want articles list==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>1931</id>
      <timestamp>2012-07-27T10:06:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Pages ToDo */</comment>
      <text xml:space="preserve" bytes="1129">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Article_flags | Article flags]]
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Noticing_templates | Noticing templates]]
* [[:Category:Entity_templates | Entity templates]]

==Pages ToDo==
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_outdated | Outdated articles]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]

==Other page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Want articles list==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>1942</id>
      <timestamp>2012-07-27T10:40:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1073">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Article_flags | Article flags]]
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]

==Pages ToDo==
* [[:Category:Article_unfinished | Unfinished articles]]
* [[:Category:Article_outdated | Outdated articles]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]

==Other page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Want articles list==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>2007</id>
      <timestamp>2012-07-27T14:09:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1067">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Page bricks | Page bricks]]
* [[:Category:Entity_templates | Entity templates]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]

==Special page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Wanted pages list==
Add here a pages you want to see created.</text>
    </revision>
    <revision>
      <id>2008</id>
      <timestamp>2012-07-27T14:09:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1078">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Page bricks | Page bricks]]
* [[:Category:Entity_templates | Entity templates]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]

==Special page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2014</id>
      <timestamp>2012-07-27T14:25:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1076">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Page marks | Page marks]]
* [[:Category:Entity_templates | Entity templates]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]

==Special page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2016</id>
      <timestamp>2012-07-27T14:28:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Templates */</comment>
      <text xml:space="preserve" bytes="1076">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Linked articles that doesnt exist]]

==Special page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2021</id>
      <timestamp>2012-07-27T14:31:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1052">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Article_WIP | Work-In-Progress pages]]
* [[:Category:Article_ancient | Ancient pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2030</id>
      <timestamp>2012-07-27T14:47:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Special page categories */</comment>
      <text xml:space="preserve" bytes="1015">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2038</id>
      <timestamp>2012-07-27T15:07:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1065">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2042</id>
      <timestamp>2012-07-27T15:08:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Special page categories */</comment>
      <text xml:space="preserve" bytes="1065">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2172</id>
      <timestamp>2012-07-29T20:55:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1111">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Special:WantedPages | Red links]]
* [[:Category:Check grammar | Check grammar]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2174</id>
      <timestamp>2012-07-29T20:57:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1111">==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Category:Check grammar | Check grammar]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2193</id>
      <timestamp>2012-07-30T04:50:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1146">{{DISPLAYTITLE:Community portal}}

==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Category:Check grammar | Check grammar]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2194</id>
      <timestamp>2012-07-30T04:50:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1145">{{DISPLAYTITLE:Community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Category:Check grammar | Check grammar]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2195</id>
      <timestamp>2012-07-30T04:50:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1156">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to be Maked==
* [[:Category:Unfinished pages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Category:Check grammar | Check grammar]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2232</id>
      <timestamp>2012-07-30T19:51:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1154">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[:Category:Outdated pages | Outdated pages]]
* [[:Category:Check grammar | Check grammar]]
* [[:Special:WantedPages | Red links]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2240</id>
      <timestamp>2012-07-30T20:05:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1071">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[:Special:WantedPages | Missing linked pages]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2245</id>
      <timestamp>2012-07-30T20:08:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Pages to work on */</comment>
      <text xml:space="preserve" bytes="1133">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]

==Special page categories==
* [[:Category:Work-In-Progress pages | Work-In-Progress pages]]
* [[:Category:Need screenshot | Need Screenshot]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2248</id>
      <timestamp>2012-07-30T20:12:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1051">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgressPages | Work-In-Progress pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2249</id>
      <timestamp>2012-07-30T20:12:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Pages to work on */</comment>
      <text xml:space="preserve" bytes="1044">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing links]]
* [[BloodWiki:WorkInProgressPages | Work-In-Progress pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2257</id>
      <timestamp>2012-07-30T20:28:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1039">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing links]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2264</id>
      <timestamp>2012-07-30T20:32:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Pages to work on */</comment>
      <text xml:space="preserve" bytes="1046">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2397</id>
      <timestamp>2012-08-03T06:34:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1082">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2398</id>
      <timestamp>2012-08-03T06:36:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Pages to work on */</comment>
      <text xml:space="preserve" bytes="1129">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]
* [[BloodWiki:UnMarkedPages | Unmarked pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2399</id>
      <timestamp>2012-08-03T06:36:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Pages to work on */</comment>
      <text xml:space="preserve" bytes="1129">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Entity_templates | Entity templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]
* [[BloodWiki:UnmarkedPages | Unmarked pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>2955</id>
      <timestamp>2012-11-29T21:28:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1131">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Special templates | Special templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]
* [[BloodWiki:UnmarkedPages | Unmarked pages]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>3483</id>
      <timestamp>2013-01-22T19:32:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1275">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Special templates | Special templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]
* [[BloodWiki:UnmarkedPages | Unmarked pages]]

==Portal pages==
* [[:Category:InRussian|All pages in &quot;Blood Wiki in Russian&quot;]]
* [[:Category:InItalian|All pages in &quot;Blood Wiki in Italian&quot;]]

==Wanted pages list==
Add here a pages you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>3581</id>
      <timestamp>2013-02-14T15:14:33Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* Wanted pages list */</comment>
      <text xml:space="preserve" bytes="1274">{{DISPLAYTITLE:Blood wiki community portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Special templates | Special templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]
* [[BloodWiki:UnmarkedPages | Unmarked pages]]

==Portal pages==
* [[:Category:InRussian|All pages in &quot;Blood Wiki in Russian&quot;]]
* [[:Category:InItalian|All pages in &quot;Blood Wiki in Italian&quot;]]

==Wanted pages list==
Add here a page you want to see created.

__NOTOC__</text>
    </revision>
    <revision>
      <id>3582</id>
      <timestamp>2013-02-14T15:18:19Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1274">{{DISPLAYTITLE:Blood Wiki Community Portal}}
==Short guide==
When writing or extending pages please follow this rules:

* Only post info that is related to Blood Omnicide (story, development, quirks).
* Dont post too many external links.
* Learn wiki syntax and templates.
* Make links for specific terminology, so articles can be maked for them in future.
* Dont double-link things.
* Do [[Special:SpecialPages | not]] [[Special:SpecialPages | make]] too [[Special:SpecialPages | many]] links. It [[Special:SpecialPages | looks]] [[Special:SpecialPages | bad]].
* Dont be a jerk or we will ban you

==Templates==
* [[:Category:Formatting_templates | Formatting templates]]
* [[:Category:Special templates | Special templates]]
* [[:Category:Page marks | Page marks]]

==Pages to work on==
* [[BloodWiki:UnfinishedPages | Unfinished pages]]
* [[BloodWiki:ScreenshotRequiredPages | Screenshot required]]
* [[:Special:WantedPages | Missing linked pages]]
* [[BloodWiki:WorkInProgress | Work-In-Progress pages]]
* [[BloodWiki:UnmarkedPages | Unmarked pages]]

==Portal pages==
* [[:Category:InRussian|All pages in &quot;Blood Wiki in Russian&quot;]]
* [[:Category:InItalian|All pages in &quot;Blood Wiki in Italian&quot;]]

==Wanted pages list==
Add here a page you want to see created.

__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:RecentPages</title>
    <ns>4</ns>
    <id>182</id>
      <sha1>f5ew3tmoeexzjrgxykvxzlydvflmdo9</sha1>
    <revision>
      <id>2192</id>
      <timestamp>2012-07-29T22:47:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}}  * [[Darkplaces material system]] &lt;sup&gt;[''29.07.2012'']&lt;/sup&gt; * [[Darkplaces lighting]] &lt;sup&gt;[''30.07.2012'']&lt;/sup&gt; * [[DDS]] &lt;sup&gt;[''30.07.2012'']&lt;/sup&gt;&quot;</comment>
      <text xml:space="preserve" bytes="168">{{unfinished}}

* [[Darkplaces material system]] &lt;sup&gt;[''29.07.2012'']&lt;/sup&gt;
* [[Darkplaces lighting]] &lt;sup&gt;[''30.07.2012'']&lt;/sup&gt;
* [[DDS]] &lt;sup&gt;[''30.07.2012'']&lt;/sup&gt;</text>
    </revision>
    <revision>
      <id>2196</id>
      <timestamp>2012-07-30T04:51:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="206">{{DISPLAYTITLE:Recently added pages}}
{{unfinished}}

* [[Darkplaces material system]] &lt;sup&gt;[''29.07.2012'']&lt;/sup&gt;
* [[Darkplaces lighting]] &lt;sup&gt;[''30.07.2012'']&lt;/sup&gt;
* [[DDS]] &lt;sup&gt;[''30.07.2012'']&lt;/sup&gt;</text>
    </revision>
    <revision>
      <id>2197</id>
      <timestamp>2012-07-30T04:57:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="76">{{DISPLAYTITLE:Recently added pages}}
{{unfinished}}

&lt;recent limit=&quot;100&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2198</id>
      <timestamp>2012-07-30T05:00:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="60">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2204</id>
      <timestamp>2012-07-30T05:41:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="86">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;finished pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2206</id>
      <timestamp>2012-07-30T07:01:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="104">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;finished pages&quot; timestamp=&quot;D.M.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2207</id>
      <timestamp>2012-07-30T07:42:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="104">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;finished_pages&quot; timestamp=&quot;D.M.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2208</id>
      <timestamp>2012-07-30T07:42:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="113">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;Category:Finished_pages&quot; timestamp=&quot;D.M.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2209</id>
      <timestamp>2012-07-30T07:42:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="104">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;Finished_pages&quot; timestamp=&quot;D.M.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2210</id>
      <timestamp>2012-07-30T07:43:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="105">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;Finished_pages;&quot; timestamp=&quot;D.M.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2211</id>
      <timestamp>2012-07-30T07:44:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="104">{{DISPLAYTITLE:Recently added pages}}
&lt;recent limit=&quot;100&quot; category=&quot;Finished_pages&quot; timestamp=&quot;D.M.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2214</id>
      <timestamp>2012-07-30T08:36:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="54">{{DISPLAYTITLE:Recently added pages}}
{{#recent2:100}}</text>
    </revision>
    <revision>
      <id>2215</id>
      <timestamp>2012-07-30T08:36:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="53">{{DISPLAYTITLE:Recently added pages}}
{{#recent:100}}</text>
    </revision>
    <revision>
      <id>2216</id>
      <timestamp>2012-07-30T09:33:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="106">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent limit=&quot;100&quot; category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot;/&gt;</text>
    </revision>
    <revision>
      <id>2218</id>
      <timestamp>2012-07-30T18:50:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="104">{{DISPLAYTITLE:Recently finished pages}}
&lt;DynamicPageList&gt;
category  = Finished_pages
&lt;/DynamicPageList&gt;</text>
    </revision>
    <revision>
      <id>2220</id>
      <timestamp>2012-07-30T18:55:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="89">{{DISPLAYTITLE:Recently finished pages}}
{{#tag:DynamicPageList|category=Finished_pages}}</text>
    </revision>
    <revision>
      <id>2222</id>
      <timestamp>2012-07-30T18:57:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="106">{{DISPLAYTITLE:Recently finished pages}}
{{#tag:recent|limit=100|category=Finished_pages|timestamp=d.m.Y}}</text>
    </revision>
    <revision>
      <id>2224</id>
      <timestamp>2012-07-30T19:00:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="89">{{DISPLAYTITLE:Recently finished pages}}
{{#tag:DynamicPageList|category=Finished_pages}}</text>
    </revision>
    <revision>
      <id>2226</id>
      <timestamp>2012-07-30T19:16:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="94">{{DISPLAYTITLE:Recently finished pages}}
{{#tag:recent|category=Finished_pages|timestamp=dmY}}</text>
    </revision>
    <revision>
      <id>2228</id>
      <timestamp>2012-07-30T19:18:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="95">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2230</id>
      <timestamp>2012-07-30T19:48:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[BloodWiki:Recent pages]] to [[BloodWiki:RecentPages]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="95">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2298</id>
      <timestamp>2012-07-30T21:51:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="105">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent limit=100 category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2362</id>
      <timestamp>2012-08-01T12:32:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="122">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent limit=100 category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot; stampsection=&quot;2&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2363</id>
      <timestamp>2012-08-01T12:42:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="122">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent limit=100 category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot; stampsection=&quot;1&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2364</id>
      <timestamp>2012-08-01T12:48:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="122">{{DISPLAYTITLE:Recently finished pages}}
&lt;recent limit=100 category=&quot;Finished_pages&quot; timestamp=&quot;d.m.Y&quot; stampsection=&quot;3&quot; /&gt;</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:ScreenshotRequiredPages</title>
    <ns>4</ns>
    <id>186</id>
      <sha1>a1kb5boeclfnk51mzrlvh1w3561aqaw</sha1>
    <revision>
      <id>2246</id>
      <timestamp>2012-07-30T20:10:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Blood Wiki Pages requiring screenshots}} &lt;recent limit=100 category=&quot;Need_screenshot&quot; /&gt;&quot;</comment>
      <text xml:space="preserve" bytes="103">{{DISPLAYTITLE:Blood Wiki Pages requiring screenshots}}
&lt;recent limit=100 category=&quot;Need_screenshot&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2259</id>
      <timestamp>2012-07-30T20:30:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="119">{{DISPLAYTITLE:Blood Wiki Pages requiring screenshots}}
&lt;recent limit=100 category=&quot;Need_screenshot&quot; empty=&quot;No pages /&gt;</text>
    </revision>
    <revision>
      <id>2262</id>
      <timestamp>2012-07-30T20:30:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="120">{{DISPLAYTITLE:Blood Wiki Pages requiring screenshots}}
&lt;recent limit=100 category=&quot;Need_screenshot&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:Terms of use</title>
    <ns>4</ns>
    <id>310</id>
      <sha1>184itiyqhfzsbw63ohb38be4wmcfbur</sha1>
    <revision>
      <id>2890</id>
      <timestamp>2012-11-23T00:49:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{TOCFLOAT}} Welcome to Blood Wiki (the “Wiki”, the &quot;Service&quot;), operated by Razorwind Games (the &quot;Company&quot;). Please read this Agreement carefully before accessing or using...&quot;</comment>
      <text xml:space="preserve" bytes="5259">{{TOCFLOAT}}
Welcome to Blood Wiki (the “Wiki”, the &quot;Service&quot;), operated by Razorwind Games (the &quot;Company&quot;). Please read this Agreement carefully before accessing or using the Wiki. By accessing or using any part of the wiki, you (the &quot;User&quot;) agree to become bound by the terms and conditions of this agreement. If you do not agree to all the terms and conditions of this agreement, then you may not access the Wiki or use any services it provides.

'''Please read these these terms of use carefully as they contain important information regarding your legal rights, remedies and obligations, including but not limited to limitations and exclusions, and a dispute resolution clause that governs how disputes will be resolved.'''

These Terms of Use apply to members and non-members alike, including users who are also contributors of content, information, and other materials or services on the Wiki. The Blood Wiki may contain links to third party websites or files that are not owned or controlled by Razorwind Games. Razorwind Games has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party websites. In addition, Razorwind Games will not and cannot censor or edit the content of any third-party site. By using the Wiki, you expressly relieve Razorwind Games from any and all liability arising from your use of any third-party website. Accordingly, we encourage you to be aware when you leave the Wiki and to read the terms and conditions and privacy policy of each other website that you visit.

==User Agreement==
'''You agree not to use the Service to''':
* Abuse, threaten, harass, impersonate or intimidate other users;
* Post or transmit any content that is obscene, pornographic, abusive, offensive, profane, or content that contains ethnic slurs, religious intolerance, or encourages criminal conduct;
* Attempt to impersonate another user or person;
* Post any illegal or unauthorized content or use for any illegal or unauthorized purposes;
* Post, upload, transmit, share, or store unsolicited or unauthorized advertising, &quot;spam&quot;, or any other type of unauthorized solicitation;
* Violate any laws in your jurisdiction (including but not limited to copyright laws and laws regarding online conduct and acceptable content);
* To post or transmit any content that contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content;
* Post advertisements or solicitations of business;

'''You further agree''':
* To only use the Wiki in a manner consistent with these Terms of Use and in compliance with applicable laws and regulations.
* Not to intentionally block, remove, or otherwise obstruct the proper functioning and view of advertisements, and/or user interface and functionality by other users, including but not limited to changing or adding javascript or CSS changes to the Wiki that would prevent the proper display or function of advertisements and/or user interface and functionality.

==Submitting Content to the Wiki and Copyrights==
By uploading, submitting or otherwise contributing to the Wiki, you grant the Company and other Users a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content under [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike license].

You represent and warrant that you have sufficient rights in those materials or information to grant these rights and licenses. You also agree that Razorwind Games as described above are free to use any ideas, concepts, know-how or techniques that you submit to the Wiki for any purpose.

==Claims of Copyright Infringement==
For claims of copyright infringement, please contact us via e-mail: razorwindgames@gmail.com. Please include &quot;Claim of copyright infringement&quot; in the subject of your email.

==Disclaimers and Limitation on Liability==
While Blood Wiki provide rules for user conduct and submissions, the Company does not control it and is not responsible and is not liable in any manner for any content submitted to the Wiki.
The Company is not responsible for the content or conduct, whether online or offline, of any user of the Wiki. Razowind Games do not make any warranty that the Wiki will be error free or that access thereto will be continuous or uninterrupted. Further, you understand and acknowledge that by using the Wiki you may be exposed to content that you may find offensive, indecent or objectionable and that, in this respect, you use the Wiki at your own risk.

The Service is provided &quot;'''as-is'''&quot; and &quot;'''as available'''&quot;. The Company disclaims any and all representations and warranties, whether express or implied. The Company does not and cannot guarantee any specific results from use of the Service. '''You acknowledge that you use this service at your own risk.'''

'''In addition, the company does not represent or warrant to you that:'''

'''A. Your use of the service will meet your requirements, be they express or implied.'''
'''B. That any information obtained by you as a result of your user of the services will be free of error, accurate or reliable.'''
'''C. That errors in functionality or operation of the services will be corrected.'''</text>
    </revision>
    <revision>
      <id>2893</id>
      <timestamp>2012-11-23T01:02:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Disclaimers and Limitation on Liability */</comment>
      <text xml:space="preserve" bytes="5257">{{TOCFLOAT}}
Welcome to Blood Wiki (the “Wiki”, the &quot;Service&quot;), operated by Razorwind Games (the &quot;Company&quot;). Please read this Agreement carefully before accessing or using the Wiki. By accessing or using any part of the wiki, you (the &quot;User&quot;) agree to become bound by the terms and conditions of this agreement. If you do not agree to all the terms and conditions of this agreement, then you may not access the Wiki or use any services it provides.

'''Please read these these terms of use carefully as they contain important information regarding your legal rights, remedies and obligations, including but not limited to limitations and exclusions, and a dispute resolution clause that governs how disputes will be resolved.'''

These Terms of Use apply to members and non-members alike, including users who are also contributors of content, information, and other materials or services on the Wiki. The Blood Wiki may contain links to third party websites or files that are not owned or controlled by Razorwind Games. Razorwind Games has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party websites. In addition, Razorwind Games will not and cannot censor or edit the content of any third-party site. By using the Wiki, you expressly relieve Razorwind Games from any and all liability arising from your use of any third-party website. Accordingly, we encourage you to be aware when you leave the Wiki and to read the terms and conditions and privacy policy of each other website that you visit.

==User Agreement==
'''You agree not to use the Service to''':
* Abuse, threaten, harass, impersonate or intimidate other users;
* Post or transmit any content that is obscene, pornographic, abusive, offensive, profane, or content that contains ethnic slurs, religious intolerance, or encourages criminal conduct;
* Attempt to impersonate another user or person;
* Post any illegal or unauthorized content or use for any illegal or unauthorized purposes;
* Post, upload, transmit, share, or store unsolicited or unauthorized advertising, &quot;spam&quot;, or any other type of unauthorized solicitation;
* Violate any laws in your jurisdiction (including but not limited to copyright laws and laws regarding online conduct and acceptable content);
* To post or transmit any content that contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content;
* Post advertisements or solicitations of business;

'''You further agree''':
* To only use the Wiki in a manner consistent with these Terms of Use and in compliance with applicable laws and regulations.
* Not to intentionally block, remove, or otherwise obstruct the proper functioning and view of advertisements, and/or user interface and functionality by other users, including but not limited to changing or adding javascript or CSS changes to the Wiki that would prevent the proper display or function of advertisements and/or user interface and functionality.

==Submitting Content to the Wiki and Copyrights==
By uploading, submitting or otherwise contributing to the Wiki, you grant the Company and other Users a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content under [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike license].

You represent and warrant that you have sufficient rights in those materials or information to grant these rights and licenses. You also agree that Razorwind Games as described above are free to use any ideas, concepts, know-how or techniques that you submit to the Wiki for any purpose.

==Claims of Copyright Infringement==
For claims of copyright infringement, please contact us via e-mail: razorwindgames@gmail.com. Please include &quot;Claim of copyright infringement&quot; in the subject of your email.

==Disclaimers and Limitation on Liability==
While Blood Wiki provide rules for user conduct and submissions, the Company does not control it and is not responsible and is not liable in any manner for any content submitted to the Wiki.
The Company is not responsible for the content or conduct, whether online or offline, of any user of the Wiki. Razowind Games do not make any warranty that the Wiki will be error free or that access thereto will be continuous or uninterrupted. Further, you understand and acknowledge that by using the Wiki you may be exposed to content that you may find offensive, indecent or objectionable and that, in this respect, you use the Wiki at your own risk.

The Service is provided &quot;'''as-is'''&quot; and &quot;'''as available'''&quot;. The Company disclaims any and all representations and warranties, whether express or implied. The Company does not and cannot guarantee any specific results from use of the Service. 

'''You acknowledge that you use this service at your own risk.'''

In addition, the company does not represent or warrant to you that:

'''A. Your use of the service will meet your requirements, be they express or implied.'''

'''B. That any information obtained by you as a result of your user of the services will be free of error, accurate or reliable.'''

'''C. That errors in functionality or operation of the services will be corrected.'''</text>
    </revision>
    <revision>
      <id>2896</id>
      <timestamp>2012-11-23T01:13:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5257">{{TOCRIGHT}}
Welcome to Blood Wiki (the “Wiki”, the &quot;Service&quot;), operated by Razorwind Games (the &quot;Company&quot;). Please read this Agreement carefully before accessing or using the Wiki. By accessing or using any part of the wiki, you (the &quot;User&quot;) agree to become bound by the terms and conditions of this agreement. If you do not agree to all the terms and conditions of this agreement, then you may not access the Wiki or use any services it provides.

'''Please read these these terms of use carefully as they contain important information regarding your legal rights, remedies and obligations, including but not limited to limitations and exclusions, and a dispute resolution clause that governs how disputes will be resolved.'''

These Terms of Use apply to members and non-members alike, including users who are also contributors of content, information, and other materials or services on the Wiki. The Blood Wiki may contain links to third party websites or files that are not owned or controlled by Razorwind Games. Razorwind Games has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party websites. In addition, Razorwind Games will not and cannot censor or edit the content of any third-party site. By using the Wiki, you expressly relieve Razorwind Games from any and all liability arising from your use of any third-party website. Accordingly, we encourage you to be aware when you leave the Wiki and to read the terms and conditions and privacy policy of each other website that you visit.

==User Agreement==
'''You agree not to use the Service to''':
* Abuse, threaten, harass, impersonate or intimidate other users;
* Post or transmit any content that is obscene, pornographic, abusive, offensive, profane, or content that contains ethnic slurs, religious intolerance, or encourages criminal conduct;
* Attempt to impersonate another user or person;
* Post any illegal or unauthorized content or use for any illegal or unauthorized purposes;
* Post, upload, transmit, share, or store unsolicited or unauthorized advertising, &quot;spam&quot;, or any other type of unauthorized solicitation;
* Violate any laws in your jurisdiction (including but not limited to copyright laws and laws regarding online conduct and acceptable content);
* To post or transmit any content that contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content;
* Post advertisements or solicitations of business;

'''You further agree''':
* To only use the Wiki in a manner consistent with these Terms of Use and in compliance with applicable laws and regulations.
* Not to intentionally block, remove, or otherwise obstruct the proper functioning and view of advertisements, and/or user interface and functionality by other users, including but not limited to changing or adding javascript or CSS changes to the Wiki that would prevent the proper display or function of advertisements and/or user interface and functionality.

==Submitting Content to the Wiki and Copyrights==
By uploading, submitting or otherwise contributing to the Wiki, you grant the Company and other Users a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content under [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike license].

You represent and warrant that you have sufficient rights in those materials or information to grant these rights and licenses. You also agree that Razorwind Games as described above are free to use any ideas, concepts, know-how or techniques that you submit to the Wiki for any purpose.

==Claims of Copyright Infringement==
For claims of copyright infringement, please contact us via e-mail: razorwindgames@gmail.com. Please include &quot;Claim of copyright infringement&quot; in the subject of your email.

==Disclaimers and Limitation on Liability==
While Blood Wiki provide rules for user conduct and submissions, the Company does not control it and is not responsible and is not liable in any manner for any content submitted to the Wiki.
The Company is not responsible for the content or conduct, whether online or offline, of any user of the Wiki. Razowind Games do not make any warranty that the Wiki will be error free or that access thereto will be continuous or uninterrupted. Further, you understand and acknowledge that by using the Wiki you may be exposed to content that you may find offensive, indecent or objectionable and that, in this respect, you use the Wiki at your own risk.

The Service is provided &quot;'''as-is'''&quot; and &quot;'''as available'''&quot;. The Company disclaims any and all representations and warranties, whether express or implied. The Company does not and cannot guarantee any specific results from use of the Service. 

'''You acknowledge that you use this service at your own risk.'''

In addition, the company does not represent or warrant to you that:

'''A. Your use of the service will meet your requirements, be they express or implied.'''

'''B. That any information obtained by you as a result of your user of the services will be free of error, accurate or reliable.'''

'''C. That errors in functionality or operation of the services will be corrected.'''</text>
    </revision>
    <revision>
      <id>2929</id>
      <timestamp>2012-11-23T04:55:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* User Agreement */</comment>
      <text xml:space="preserve" bytes="5235">{{TOCRIGHT}}
Welcome to Blood Wiki (the “Wiki”, the &quot;Service&quot;), operated by Razorwind Games (the &quot;Company&quot;). Please read this Agreement carefully before accessing or using the Wiki. By accessing or using any part of the wiki, you (the &quot;User&quot;) agree to become bound by the terms and conditions of this agreement. If you do not agree to all the terms and conditions of this agreement, then you may not access the Wiki or use any services it provides.

'''Please read these these terms of use carefully as they contain important information regarding your legal rights, remedies and obligations, including but not limited to limitations and exclusions, and a dispute resolution clause that governs how disputes will be resolved.'''

These Terms of Use apply to members and non-members alike, including users who are also contributors of content, information, and other materials or services on the Wiki. The Blood Wiki may contain links to third party websites or files that are not owned or controlled by Razorwind Games. Razorwind Games has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party websites. In addition, Razorwind Games will not and cannot censor or edit the content of any third-party site. By using the Wiki, you expressly relieve Razorwind Games from any and all liability arising from your use of any third-party website. Accordingly, we encourage you to be aware when you leave the Wiki and to read the terms and conditions and privacy policy of each other website that you visit.

==User Agreement==
'''You agree not to use the Service to''':
* Abuse, threaten, harass, impersonate or intimidate other users;
* Post or transmit any content that is obscene, pornographic, abusive, offensive, profane, or content that contains ethnic slurs, religious intolerance, or encourages criminal conduct;
* Attempt to impersonate another user or person;
* Post any illegal or unauthorized content or use for any illegal or unauthorized purposes;
* Post, upload, transmit, share, or store unsolicited or unauthorized advertising, &quot;spam&quot;, or any other type of unauthorized solicitation;
* Violate any laws in your jurisdiction (including but not limited to copyright laws and laws regarding online conduct and acceptable content);
* To post or transmit any content that contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content;
* Post advertisements or solicitations of business;

'''You further agree''':
* To only use the Wiki in a manner consistent with these Terms of Use and in compliance with applicable laws and regulations.
* Not to intentionally block, remove, or otherwise obstruct the proper functioning and view of advertisements, and/or user interface and functionality by other users, including but not limited to changing or adding javascript or CSS changes to the Wiki that would prevent the proper display or function of user interface and functionality.

==Submitting Content to the Wiki and Copyrights==
By uploading, submitting or otherwise contributing to the Wiki, you grant the Company and other Users a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content under [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike license].

You represent and warrant that you have sufficient rights in those materials or information to grant these rights and licenses. You also agree that Razorwind Games as described above are free to use any ideas, concepts, know-how or techniques that you submit to the Wiki for any purpose.

==Claims of Copyright Infringement==
For claims of copyright infringement, please contact us via e-mail: razorwindgames@gmail.com. Please include &quot;Claim of copyright infringement&quot; in the subject of your email.

==Disclaimers and Limitation on Liability==
While Blood Wiki provide rules for user conduct and submissions, the Company does not control it and is not responsible and is not liable in any manner for any content submitted to the Wiki.
The Company is not responsible for the content or conduct, whether online or offline, of any user of the Wiki. Razowind Games do not make any warranty that the Wiki will be error free or that access thereto will be continuous or uninterrupted. Further, you understand and acknowledge that by using the Wiki you may be exposed to content that you may find offensive, indecent or objectionable and that, in this respect, you use the Wiki at your own risk.

The Service is provided &quot;'''as-is'''&quot; and &quot;'''as available'''&quot;. The Company disclaims any and all representations and warranties, whether express or implied. The Company does not and cannot guarantee any specific results from use of the Service. 

'''You acknowledge that you use this service at your own risk.'''

In addition, the company does not represent or warrant to you that:

'''A. Your use of the service will meet your requirements, be they express or implied.'''

'''B. That any information obtained by you as a result of your user of the services will be free of error, accurate or reliable.'''

'''C. That errors in functionality or operation of the services will be corrected.'''</text>
    </revision>
    <revision>
      <id>2930</id>
      <timestamp>2012-11-23T04:56:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* User Agreement */</comment>
      <text xml:space="preserve" bytes="5179">{{TOCRIGHT}}
Welcome to Blood Wiki (the “Wiki”, the &quot;Service&quot;), operated by Razorwind Games (the &quot;Company&quot;). Please read this Agreement carefully before accessing or using the Wiki. By accessing or using any part of the wiki, you (the &quot;User&quot;) agree to become bound by the terms and conditions of this agreement. If you do not agree to all the terms and conditions of this agreement, then you may not access the Wiki or use any services it provides.

'''Please read these these terms of use carefully as they contain important information regarding your legal rights, remedies and obligations, including but not limited to limitations and exclusions, and a dispute resolution clause that governs how disputes will be resolved.'''

These Terms of Use apply to members and non-members alike, including users who are also contributors of content, information, and other materials or services on the Wiki. The Blood Wiki may contain links to third party websites or files that are not owned or controlled by Razorwind Games. Razorwind Games has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party websites. In addition, Razorwind Games will not and cannot censor or edit the content of any third-party site. By using the Wiki, you expressly relieve Razorwind Games from any and all liability arising from your use of any third-party website. Accordingly, we encourage you to be aware when you leave the Wiki and to read the terms and conditions and privacy policy of each other website that you visit.

==User Agreement==
'''You agree not to use the Service to''':
* Abuse, threaten, harass, impersonate or intimidate other users;
* Post or transmit any content that is obscene, pornographic, abusive, offensive, profane, or content that contains ethnic slurs, religious intolerance, or encourages criminal conduct;
* Attempt to impersonate another user or person;
* Post any illegal or unauthorized content or use for any illegal or unauthorized purposes;
* Post, upload, transmit, share, or store unsolicited or unauthorized advertising, &quot;spam&quot;, or any other type of unauthorized solicitation;
* Violate any laws in your jurisdiction (including but not limited to copyright laws and laws regarding online conduct and acceptable content);
* To post or transmit any content that contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content;
* Post advertisements or solicitations of business;

'''You further agree''':
* To only use the Wiki in a manner consistent with these Terms of Use and in compliance with applicable laws and regulations.
* Not to intentionally block, remove, or otherwise obstruct the proper functioning and view of user interface, including but not limited to changing or adding javascript or CSS changes to the Wiki that would prevent the proper display or function of user interface and functionality.

==Submitting Content to the Wiki and Copyrights==
By uploading, submitting or otherwise contributing to the Wiki, you grant the Company and other Users a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content under [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike license].

You represent and warrant that you have sufficient rights in those materials or information to grant these rights and licenses. You also agree that Razorwind Games as described above are free to use any ideas, concepts, know-how or techniques that you submit to the Wiki for any purpose.

==Claims of Copyright Infringement==
For claims of copyright infringement, please contact us via e-mail: razorwindgames@gmail.com. Please include &quot;Claim of copyright infringement&quot; in the subject of your email.

==Disclaimers and Limitation on Liability==
While Blood Wiki provide rules for user conduct and submissions, the Company does not control it and is not responsible and is not liable in any manner for any content submitted to the Wiki.
The Company is not responsible for the content or conduct, whether online or offline, of any user of the Wiki. Razowind Games do not make any warranty that the Wiki will be error free or that access thereto will be continuous or uninterrupted. Further, you understand and acknowledge that by using the Wiki you may be exposed to content that you may find offensive, indecent or objectionable and that, in this respect, you use the Wiki at your own risk.

The Service is provided &quot;'''as-is'''&quot; and &quot;'''as available'''&quot;. The Company disclaims any and all representations and warranties, whether express or implied. The Company does not and cannot guarantee any specific results from use of the Service. 

'''You acknowledge that you use this service at your own risk.'''

In addition, the company does not represent or warrant to you that:

'''A. Your use of the service will meet your requirements, be they express or implied.'''

'''B. That any information obtained by you as a result of your user of the services will be free of error, accurate or reliable.'''

'''C. That errors in functionality or operation of the services will be corrected.'''</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:UmarkedPages</title>
    <ns>4</ns>
    <id>189</id>
      <sha1>qogt9vz9zcj25pncxgcepaws2l6n2s7</sha1>
    <revision>
      <id>2286</id>
      <timestamp>2012-07-30T21:44:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Blood Wiki Unmarked Pages}} Search for: &lt;nowiki&gt;{{unfinished}}, {{finished}}&lt;/nowiki&gt; == Page list == &lt;recent limit=100 notcategory=&quot;Finished_pages,Unfinished_p...&quot;</comment>
      <text xml:space="preserve" bytes="200">{{DISPLAYTITLE:Blood Wiki Unmarked Pages}}
Search for: &lt;nowiki&gt;{{unfinished}}, {{finished}}&lt;/nowiki&gt;
== Page list ==
&lt;recent limit=100 notcategory=&quot;Finished_pages,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:UnfinishedPages</title>
    <ns>4</ns>
    <id>185</id>
      <sha1>gtbhma5xsfw5nq5u4li79bwt3gvzh55</sha1>
    <revision>
      <id>2233</id>
      <timestamp>2012-07-30T19:59:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Blood Wiki Unfinished Pages}} === Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] === &lt;recent limit=100 category=&quot;Unfinished_pages&quot; times...&quot;</comment>
      <text xml:space="preserve" bytes="343">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
=== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
=== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ===
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2236</id>
      <timestamp>2012-07-30T20:03:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="604">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
=== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
=== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ===
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
=== Pages marked [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;

=== Return to ===
* [[BloodWiki:Community_portal | Community portal]]
* [[Main_Page | Main page]]</text>
    </revision>
    <revision>
      <id>2237</id>
      <timestamp>2012-07-30T20:03:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="627">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
=== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
=== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ===
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
=== Pages marked [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;

=== Return to ===
* [[BloodWiki:Community_portal | Community portal]]
* [[Main_Page | Main page]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2238</id>
      <timestamp>2012-07-30T20:03:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="614">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
=== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
=== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ===
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
=== Pages marked [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ===
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;

=== Return to ===
* [[BloodWiki:Community_portal | Community portal]]
* [[Main_Page | Main page]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2239</id>
      <timestamp>2012-07-30T20:03:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="605">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
== Pages marked [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Return to ==
* [[BloodWiki:Community_portal | Community portal]]
* [[Main_Page | Main page]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2241</id>
      <timestamp>2012-07-30T20:05:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="667">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
== Pages marked [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Pages marked [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2242</id>
      <timestamp>2012-07-30T20:06:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="665">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2243</id>
      <timestamp>2012-07-30T20:06:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="349">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2244</id>
      <timestamp>2012-07-30T20:07:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="665">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2251</id>
      <timestamp>2012-07-30T20:19:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="669">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2258</id>
      <timestamp>2012-07-30T20:29:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="734">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; empty=&quot;No pages&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; empty=&quot;No pages /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2263</id>
      <timestamp>2012-07-30T20:30:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="737">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; empty=&quot;No pages&quot; /&gt;
== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2270</id>
      <timestamp>2012-07-30T20:38:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="591">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Pages marked [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; empty=&quot;No pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages&quot; /&gt;
== Marked with [[Template:outdated | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages&quot; /&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2328</id>
      <timestamp>2012-07-30T22:12:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="435">{{DISPLAYTITLE:Blood Wiki Unfinished Pages}}
== Unfinished pages ==
&lt;recent limit=100 category=&quot;Unfinished_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; empty=&quot;No pages&quot; /&gt;
== Outdated pages ==
&lt;recent limit=100 category=&quot;Outdated_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages&quot; /&gt;
== Check grammar ==
&lt;recent limit=100 category=&quot;Check_grammar&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y&quot; empty=&quot;No pages&quot; /&gt;
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:UnmarkedPages</title>
    <ns>4</ns>
    <id>188</id>
      <sha1>9zrzeldzfirf9l2prkjzgjn9r668lmv</sha1>
    <revision>
      <id>2271</id>
      <timestamp>2012-07-30T20:38:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark == &lt;recent limit=100 notcategory=&quot;Finished_pages&quot; empty=&quot;No pages&quot; /&gt;&quot;</comment>
      <text xml:space="preserve" bytes="145">== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2281</id>
      <timestamp>2012-07-30T21:06:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="161">== Pages with no [[Template:finished | &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt;]] mark ==
&lt;recent limit=100 notcategory=&quot;Finished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2282</id>
      <timestamp>2012-07-30T21:07:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="205">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt;
== Page list ==
&lt;recent limit=100 notcategory=&quot;Finished_pages,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2283</id>
      <timestamp>2012-07-30T21:08:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="190">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt;
== Page list ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2284</id>
      <timestamp>2012-07-30T21:08:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="205">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt;
== Page list ==
&lt;recent limit=100 notcategory=&quot;Finished_pages,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2285</id>
      <timestamp>2012-07-30T21:08:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="190">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt;
== Page list ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2299</id>
      <timestamp>2012-07-30T21:52:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="205">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt;
== Page list ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2390</id>
      <timestamp>2012-08-03T06:18:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="195">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2391</id>
      <timestamp>2012-08-03T06:18:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="345">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Search for: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check_grammar,Grammar_checked&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2392</id>
      <timestamp>2012-08-03T06:19:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="362">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Search for: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check_grammar,Grammar_checked,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2394</id>
      <timestamp>2012-08-03T06:20:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="498">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Search for: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check_grammar,Grammar_checked,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Search for: &lt;nowiki&gt;{{grammar checked}}&lt;/nowiki&gt; ==
&lt;recent limit=100 category=&quot;Grammar_checked&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2395</id>
      <timestamp>2012-08-03T06:21:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="378">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Search for: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Search for: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check_grammar,Grammar_checked,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2396</id>
      <timestamp>2012-08-03T06:32:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="388">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Not in category: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Not in category: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check_grammar,Grammar_checked,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2700</id>
      <timestamp>2012-09-28T13:23:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Not in category: {{grammar}}, {{grammar checked}}, {{unfinished}} */</comment>
      <text xml:space="preserve" bytes="388">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Not in category: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Not in category: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check grammar,Grammar_checked,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2701</id>
      <timestamp>2012-09-28T13:23:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="388">{{DISPLAYTITLE:Blood Wiki Pages with no marks}}
== Not in category: &lt;nowiki&gt;{{finished}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Unfinished_pages,Finished_pages&quot; empty=&quot;No pages&quot; /&gt;
== Not in category: &lt;nowiki&gt;{{grammar}}, {{grammar checked}}, {{unfinished}}&lt;/nowiki&gt; ==
&lt;recent limit=100 notcategory=&quot;Check_grammar,Grammar_checked,Unfinished_pages&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
  </page>
  <page>
    <title>BloodWiki:WorkInProgress</title>
    <ns>4</ns>
    <id>187</id>
      <sha1>hgh1974qlp4pe4ojksiz6bh9ohg1e5n</sha1>
    <revision>
      <id>2254</id>
      <timestamp>2012-07-30T20:27:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Blood Wiki Work-In-Progess pages}} &lt;recent limit=100 category=&quot;Work-In-Progress_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; /&gt;&quot;</comment>
      <text xml:space="preserve" bytes="148">{{DISPLAYTITLE:Blood Wiki Work-In-Progess pages}}
&lt;recent limit=100 category=&quot;Work-In-Progress_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2255</id>
      <timestamp>2012-07-30T20:27:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="149">{{DISPLAYTITLE:Blood Wiki Work-In-Progress pages}}
&lt;recent limit=100 category=&quot;Work-In-Progress_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2256</id>
      <timestamp>2012-07-30T20:28:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[BloodWiki:WorkInProgressPages]] to [[BloodWiki:WorkInProgress]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="149">{{DISPLAYTITLE:Blood Wiki Work-In-Progress pages}}
&lt;recent limit=100 category=&quot;Work-In-Progress_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; /&gt;</text>
    </revision>
    <revision>
      <id>2260</id>
      <timestamp>2012-07-30T20:30:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="165">{{DISPLAYTITLE:Blood Wiki Work-In-Progress pages}}
&lt;recent limit=100 category=&quot;Work-In-Progress_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; empty=&quot;No pages /&gt;</text>
    </revision>
    <revision>
      <id>2261</id>
      <timestamp>2012-07-30T20:30:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="166">{{DISPLAYTITLE:Blood Wiki Work-In-Progress pages}}
&lt;recent limit=100 category=&quot;Work-In-Progress_pages&quot; timestamp=&quot;\l\a\s\t \e\d\i\t\e\d d.m.y h:m&quot; empty=&quot;No pages&quot; /&gt;</text>
    </revision>
  </page>
  <page>
    <title>Brush</title>
    <ns>0</ns>
    <id>86</id>
      <sha1>8t9b2pezecasszo7vogmnsjbcb2ummt</sha1>
    <revision>
      <id>854</id>
      <timestamp>2012-07-16T18:04:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{article unfinished}}  Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].  Brush is [[CSG | consecutive solid geo...&quot;</comment>
      <text xml:space="preserve" bytes="520">{{article unfinished}}

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.</text>
    </revision>
    <revision>
      <id>855</id>
      <timestamp>2012-07-16T18:04:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="543">{{article unfinished}}

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>858</id>
      <timestamp>2012-07-16T18:08:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="571">{{article unfinished}}

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[File:Radiant brush.jpg]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>859</id>
      <timestamp>2012-07-16T18:09:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="577">{{article unfinished}}

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[File:Radiant brush.jpg|100px]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>860</id>
      <timestamp>2012-07-16T18:09:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="577">{{article unfinished}}

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[File:Radiant brush.jpg|320px]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>861</id>
      <timestamp>2012-07-16T18:10:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="583">{{article unfinished}}

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[File:Radiant brush.jpg|320px|right]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>862</id>
      <timestamp>2012-07-16T18:10:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="584">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right]]


Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>863</id>
      <timestamp>2012-07-16T18:10:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="590">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb]]


Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>864</id>
      <timestamp>2012-07-16T18:12:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="632">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]


Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, all brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>865</id>
      <timestamp>2012-07-16T18:41:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2549">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

= Introduction =

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Working with Brushes =
Net radiant allows several ways to work with brushes:
* Move/Rotate/Extend (default tool)
* Slice (2d and 3d plane)
* Drag components (only of resulting brush is valid)
** Vertexes
** Edges
** Planes
* Creating new brush primitives
** Cube (Default)
** Prism
** Cone
** Sphere
** Rock (random sliced cube)
* CSG operations
** Make hollow (makes brush hollow inside with wall thickness = grid point)
** Substract (&quot;cut out&quot; or &quot;subtract&quot; one brush with another)
** Merge (merges multiple brushes into one brush)
* Scale
* Flipping
* Arbitrary rotation

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>866</id>
      <timestamp>2012-07-16T18:41:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1972">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

= Introduction =

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>867</id>
      <timestamp>2012-07-16T18:48:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2813">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

= Introduction =

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

This physics-related contents of the brush which could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but whether brush can block other visible stuff. Opaque brushes will make a split in VIS data, so geometry and entities behind it can be culled out for sake of speed. Detail brushes and [[bmodel | bmodels]] are always 'transparent'.

If brush have sided which is marked detailed or transparent, it will be transparent too.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>868</id>
      <timestamp>2012-07-16T18:50:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Volume properties */</comment>
      <text xml:space="preserve" bytes="2803">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

= Introduction =

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but whether brush can block other visible stuff. Opaque brushes will make a split in VIS data, so geometry and entities behind it can be culled out for sake of speed. Detail brushes and [[bmodel | bmodels]] are always 'transparent'.

If brush have sides which is marked detailed or transparent, it will be transparent too.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>869</id>
      <timestamp>2012-07-16T18:51:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2850">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

= Introduction =

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch | patches]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but whether brush can block other visible stuff. Opaque brushes will make a split in VIS data, so geometry and entities behind it can be culled out for sake of speed. Detail brushes and [[bmodel | bmodels]] are always 'transparent'.

If brush have sides which is marked detailed or transparent, it will be transparent too.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>870</id>
      <timestamp>2012-07-16T18:53:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2860">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

= Introduction =

Brush is a simpliest geometry unit in a level. Other geometry units are [[misc_model]] and [[patch mesh | patch meshes]].

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but whether brush can block other visible stuff. Opaque brushes will make a split in VIS data, so geometry and entities behind it can be culled out for sake of speed. Detail brushes and [[bmodel | bmodels]] are always 'transparent'.

If brush have sides which is marked detailed or transparent, it will be transparent too.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>873</id>
      <timestamp>2012-07-16T19:01:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3111">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>875</id>
      <timestamp>2012-07-16T19:09:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3134">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertexes, it doesnt have [[texture coordinates]], it is using texture projection which follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>954</id>
      <timestamp>2012-07-16T20:59:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Projection */</comment>
      <text xml:space="preserve" bytes="3132">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it doesnt have [[texture coordinates]], it is using texture projection and follows this rules:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>955</id>
      <timestamp>2012-07-16T20:59:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Projection */</comment>
      <text xml:space="preserve" bytes="3142">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it doesnt have [[texture coordinates]], it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>956</id>
      <timestamp>2012-07-16T21:00:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Projection */</comment>
      <text xml:space="preserve" bytes="3102">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* There are number of texture projection commands to make life easier on brush texturing
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>957</id>
      <timestamp>2012-07-16T21:00:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Projection */</comment>
      <text xml:space="preserve" bytes="3013">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original textures detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>958</id>
      <timestamp>2012-07-16T21:01:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Projection */</comment>
      <text xml:space="preserve" bytes="3012">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter 
# Texture position is scaled by plane's ''stretch'' (x and y)
# Texture position is shifted by plane's ''offset'' (x and y)
# Using texture dimensions, positions is converted to texture coordinates

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work
* A little easier to control texture detail
* No texture breakage when model is sliced
* Can scale model with keeping original texture detail
* Can modify brush in various ways with no texture breakage (make wall longer for example)

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>959</id>
      <timestamp>2012-07-16T21:02:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Projection */</comment>
      <text xml:space="preserve" bytes="3024">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed values:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>960</id>
      <timestamp>2012-07-16T21:02:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* 1. Brush contents */</comment>
      <text xml:space="preserve" bytes="3017">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and will lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>961</id>
      <timestamp>2012-07-16T21:02:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* 1. Brush contents */</comment>
      <text xml:space="preserve" bytes="3018">{{article unfinished}}

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>962</id>
      <timestamp>2012-07-16T21:16:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3012">= Introduction =

[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>963</id>
      <timestamp>2012-07-16T21:16:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3005">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[CSG]]
* [[BModel]]
* [[BSP]]
* [[Radiant Glossary]]

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>964</id>
      <timestamp>2012-07-16T21:17:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* See also */</comment>
      <text xml:space="preserve" bytes="3006">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[CSG]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>965</id>
      <timestamp>2012-07-16T21:18:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2996">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several properties.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>967</id>
      <timestamp>2012-07-16T21:20:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Volume properties */</comment>
      <text xml:space="preserve" bytes="2990">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

= Texture Projection =

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

= Volume properties =

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>968</id>
      <timestamp>2012-07-16T21:21:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3058">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

Since brushes define volume, they are used for water, lava and slime.

{{hidden begin | Texture projection on brushes - benefits and drawbacks }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

= Volume properties =

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>969</id>
      <timestamp>2012-07-16T21:21:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2987">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes - benefits and drawbacks }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

= Volume properties =

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>970</id>
      <timestamp>2012-07-16T21:21:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2988">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane


{{hidden begin | Texture projection on brushes - benefits and drawbacks }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

= Volume properties =

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>971</id>
      <timestamp>2012-07-16T21:21:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2987">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes - benefits and drawbacks }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

= Volume properties =

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

= See also =
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1052</id>
      <timestamp>2012-07-17T20:37:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2991">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes - benefits and drawbacks }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

With limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1148</id>
      <timestamp>2012-07-17T23:47:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2997">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes - benefits and drawbacks }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1284</id>
      <timestamp>2012-07-20T07:56:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2972">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UWV unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1285</id>
      <timestamp>2012-07-20T07:57:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2972">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>2303</id>
      <timestamp>2012-07-30T21:54:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2976">[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush VIS transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]


[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>2304</id>
      <timestamp>2012-07-30T21:55:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2989">{{unfinished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush VIS transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[bmodel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2324</id>
      <timestamp>2012-07-30T22:01:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2989">{{unfinished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) to gases (fogs), depending on the textures and shaders applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{hidden begin | Texture projection on brushes }}

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture breakage when model is sliced.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

{{hidden end}}

== Volume properties ==

Brush volume have several uses.

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky (not used on Blood Omnicide)

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush VIS transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (radiant's feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2744</id>
      <timestamp>2012-10-08T11:43:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2892">{{unfinished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[path mesh|patch meshes]]. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) depending on the textures and materials applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

=== Texture projection ===

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

== Brush volume ==

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush VIS transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2745</id>
      <timestamp>2012-10-08T11:44:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2889">{{unfinished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[path mesh|patch meshes]]. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) depending on the textures and materials applied to them. 

Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

=== Brush texturing ===

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

== Brush volume ==

=== 1. Brush contents ===

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

=== 2. Brush VIS transparency ===

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2748</id>
      <timestamp>2012-10-08T13:06:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3219">{{unfinished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]]. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) depending on the textures and materials applied to them. 

=== Shape ===

Brush is [[CSG|consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{Important|If modifying brush shape, all this rules should be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant do not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2749</id>
      <timestamp>2012-10-08T13:12:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3229">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]]. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) depending on the textures and materials applied to them. 

=== Shape ===

Brush is [[CSG|consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{Important|If modifying brush shape, all this rules should be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant do not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2750</id>
      <timestamp>2012-10-08T13:58:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5838">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of it's sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Minimum 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane

{{Important|If modifying brush shape, all this rules should be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant do not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coords = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

=== Usage ===

Brushes are essential thing to make geometry that requires a volume to function properly (water, triggers), level hull structure (the geometry that forms [[VIS]] portal tree) and grude procedural geometry which is used to connect rooms together. It can also be used to create semi-complex geometry on detail objects. For quite complex and small objects, [[patch mesh|patch meshes]] and triangle models are better and more easier to make.

Examples of usage:

{| cellspacing=0 cellpadding=2 style=&quot;width:100%&quot;
| width=5% align=right | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=85% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| align=right | Walls: 
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Description is pretty same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| align=right | Statue: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| align=right | Chair: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Actually its pretty same as for statue. Chair is too complex for brushes, and also it's pretty stock at its form. So its easier to make it with misc_gamemodel.
|-
| align=right | Terrain: 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|}

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2754</id>
      <timestamp>2012-10-10T09:51:40Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="5873">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture get projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
* Texturing may brake if texture resolution is changed (there is a material trick to bypass that)

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

=== Usage ===

Brushes are essential thing to make geometry that requires a volume to function properly (water, triggers), level hull structure (the geometry that forms [[VIS]] portal tree) and grude procedural geometry which is used to connect rooms together. It can also be used to create semi-complex geometry on detail objects. For quite complex and small objects, [[patch mesh|patch meshes]] and triangle models are better and more easier to make.

Examples of usage:

{| cellspacing=0 cellpadding=2 style=&quot;width:100%&quot;
| width=5% align=right | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=85% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| align=right | Walls: 
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Description is pretty same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| align=right | Statue: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| align=right | Chair: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Actually its pretty same as for statue. Chair is too complex for brushes, and also it's pretty stock at its form. So its easier to make it with misc_gamemodel.
|-
| align=right | Terrain: 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|}

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2755</id>
      <timestamp>2012-10-10T09:56:38Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Texturing */</comment>
      <text xml:space="preserve" bytes="5879">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may brake if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the followed:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

=== Usage ===

Brushes are essential thing to make geometry that requires a volume to function properly (water, triggers), level hull structure (the geometry that forms [[VIS]] portal tree) and grude procedural geometry which is used to connect rooms together. It can also be used to create semi-complex geometry on detail objects. For quite complex and small objects, [[patch mesh|patch meshes]] and triangle models are better and more easier to make.

Examples of usage:

{| cellspacing=0 cellpadding=2 style=&quot;width:100%&quot;
| width=5% align=right | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=85% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| align=right | Walls: 
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Description is pretty same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| align=right | Statue: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| align=right | Chair: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Actually its pretty same as for statue. Chair is too complex for brushes, and also it's pretty stock at its form. So its easier to make it with misc_gamemodel.
|-
| align=right | Terrain: 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|}

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2756</id>
      <timestamp>2012-10-10T09:59:30Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Brush contents */</comment>
      <text xml:space="preserve" bytes="5878">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may brake if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

=== Usage ===

Brushes are essential thing to make geometry that requires a volume to function properly (water, triggers), level hull structure (the geometry that forms [[VIS]] portal tree) and grude procedural geometry which is used to connect rooms together. It can also be used to create semi-complex geometry on detail objects. For quite complex and small objects, [[patch mesh|patch meshes]] and triangle models are better and more easier to make.

Examples of usage:

{| cellspacing=0 cellpadding=2 style=&quot;width:100%&quot;
| width=5% align=right | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=85% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| align=right | Walls: 
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Description is pretty same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| align=right | Statue: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| align=right | Chair: 
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Actually its pretty same as for statue. Chair is too complex for brushes, and also it's pretty stock at its form. So its easier to make it with misc_gamemodel.
|-
| align=right | Terrain: 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|}

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2757</id>
      <timestamp>2012-10-10T10:13:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Usage */</comment>
      <text xml:space="preserve" bytes="6549">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may brake if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if brush have sides which is marked detailed or transparent, it will be forced transparent.

=== Brush vs Patch mesh vs Triangle model ===

Brushes are essential things to make:
* Geometry that requires a volume to function properly (water, triggers)
* Level hull structure (the geometry that forms [[VIS]] portal tree) 
* Geometry used to connect rooms together.

Brushes are good things to make:
* Simple detail objects used to cover corners and connect parts of level together
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor)

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and more easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|-
| House 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter it's height without texture breakage, which may be easy way to make villages. But house is complex object, and making it with brushes may get hard and uneffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2759</id>
      <timestamp>2012-10-10T10:21:05Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* VIS transparency */</comment>
      <text xml:space="preserve" bytes="6542">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may brake if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

=== Brush vs Patch mesh vs Triangle model ===

Brushes are essential things to make:
* Geometry that requires a volume to function properly (water, triggers)
* Level hull structure (the geometry that forms [[VIS]] portal tree) 
* Geometry used to connect rooms together.

Brushes are good things to make:
* Simple detail objects used to cover corners and connect parts of level together
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor)

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and more easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|-
| House 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter it's height without texture breakage, which may be easy way to make villages. But house is complex object, and making it with brushes may get hard and uneffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant Glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2763</id>
      <timestamp>2012-10-10T10:22:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6559">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may brake if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

=== Brush vs Patch mesh vs Triangle model ===

Brushes are essential things to make:
* Geometry that requires a volume to function properly (water, triggers)
* Level hull structure (the geometry that forms [[VIS]] portal tree) 
* Geometry used to connect rooms together.

Brushes are good things to make:
* Simple detail objects used to cover corners and connect parts of level together
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor)

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and more easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|-
| House 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter it's height without texture breakage, which may be easy way to make villages. But house is complex object, and making it with brushes may get hard and uneffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2765</id>
      <timestamp>2012-10-10T10:25:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Texturing */</comment>
      <text xml:space="preserve" bytes="6559">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

=== Shape ===

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

=== Texturing ===

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

=== Volume ===

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

=== Brush vs Patch mesh vs Triangle model ===

Brushes are essential things to make:
* Geometry that requires a volume to function properly (water, triggers)
* Level hull structure (the geometry that forms [[VIS]] portal tree) 
* Geometry used to connect rooms together.

Brushes are good things to make:
* Simple detail objects used to cover corners and connect parts of level together
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor)

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and more easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|-
| House 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter it's height without texture breakage, which may be easy way to make villages. But house is complex object, and making it with brushes may get hard and uneffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2766</id>
      <timestamp>2012-10-10T10:28:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6551">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential things to make:
* Geometry that requires a volume to function properly (water, triggers)
* Level hull structure (the geometry that forms [[VIS]] portal tree) 
* Geometry used to connect rooms together.

Brushes are good things to make:
* Simple detail objects used to cover corners and connect parts of level together
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor)

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and more easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you are ofter reconfiguring your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue withg be either crude or will take insane abount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Small chunks of terrain is good to make with brushes, as they can be reconfigured in editor and dont need a works with exporting/importing as for models. Brushes also part of the .map file, so it dont generates any external files. Vertex alpha should be handled by colormod brushes. The big landscapes is not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite uneffective for it.
|-
| House 
| &lt;font color=orange&gt;may be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter it's height without texture breakage, which may be easy way to make villages. But house is complex object, and making it with brushes may get hard and uneffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2767</id>
      <timestamp>2012-10-10T10:51:27Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Brush vs Patch mesh vs Triangle model */</comment>
      <text xml:space="preserve" bytes="6545">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2768</id>
      <timestamp>2012-10-10T10:52:20Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="6559">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG). It uses a form made of its sides and a volume which is anyting inside. CSG brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2769</id>
      <timestamp>2012-10-10T11:21:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6713">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|600px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2771</id>
      <timestamp>2012-10-10T11:37:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6713">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to CSG rules breakage, resulting brush will become invalid. For most cases Radiant does not allow you to do that.}}

[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2772</id>
      <timestamp>2012-10-10T11:39:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6737">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|If modifying brush shape, all these rules must be followed. Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to non-convex figure, resulting brush becomes invalid. For most of such cases Radiant does not allow you to do that, not for all though.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2773</id>
      <timestamp>2012-10-10T11:40:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6595">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to non-convex figure, resulting brush becomes invalid.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2774</id>
      <timestamp>2012-10-10T11:40:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6595">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|Radiant have tools to move/transform brush vertexes, sides and planes. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2775</id>
      <timestamp>2012-10-10T11:41:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6640">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|Radiant have tools to move/transform brush shape (vertexes, sides and planes) which is not CSG-friendly operations. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2776</id>
      <timestamp>2012-10-10T11:43:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6630">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|Radiant have tools to edit brush shape (vertexes, sides and planes) that are not CSG-friendly operations. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2777</id>
      <timestamp>2012-10-10T11:45:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6776">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|Radiant have tools to edit brush shape (vertexes, sides and planes) that are not CSG-friendly operations. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid. CSG operations ([[Radiant/CSG Substract|substract]], [[Radiant/CSG Make hollow|hollow]] and [[Radiant/Clipper|clipper]]) always make valid brush.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2778</id>
      <timestamp>2012-10-10T11:45:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shape */</comment>
      <text xml:space="preserve" bytes="6765">{{finished}}
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term &quot;brush&quot; originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them. 

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes. 

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

== Shape ==

Properly constructed brush follows this rules:

* Has at least 3 sides
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane

{{Important|Radiant have tools to edit brush shape (vertexes, sides and planes) that are not CSG-friendly. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid. CSG operations ([[Radiant/CSG Substract|substract]], [[Radiant/CSG Make hollow|hollow]] and [[Radiant/Clipper|clipper]]) always make valid brush.}}
 
[[File:Brush rules.jpg|750px]]

== Texturing ==

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
# Texture is rotated by plane's ''rotate'' parameter.
# Texture position is scaled by plane's ''stretch'' (x and y).
# Texture position is shifted by plane's ''offset'' (x and y).
# When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

* No texture coordinates = no UVW unwrap work.
* A little easier to control [[texture detail]].
* No texture UV breakage when model is sliced/expanded.
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make a wall longer for example).

== Volume ==

==== Brush contents ====

Physics-related contents of the brush. Could be one of the following:

* Solid
* Non-solid
* Water
* Slime
* Lava
* Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

==== VIS transparency ====

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

== Brush vs Patch mesh vs Triangle model ==

Brushes are essential when making:
* Geometry that requires a volume to function properly (water, triggers).
* Level hull structure (the geometry that forms [[VIS]] portal tree). 
* Geometry used to connect rooms together.

Brushes are good when making:
* Simple detail objects used to cover corners and connect parts of level together.
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls. 
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

{| cellspacing=0 cellpadding=2 border=1 style=&quot;width:100%;border-collapse:collapse&quot;
| width=10% | Room floors
| width=10% | &lt;font color=green&gt;Good choice&lt;/font&gt;
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
|-
| Walls
| &lt;font color=green&gt;Good choice&lt;/font&gt;
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls. 
|-
| Statue
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
|-
| Chair
| &lt;font color=red&gt;Not a good choice&lt;/font&gt;
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
|-
| Terrain 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
|-
| House 
| &lt;font color=orange&gt;May be good choice&lt;/font&gt;
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
|}

== See also ==
* [[Radiant/Glossary|Radiant glossary]]
* [[BModel]]
* [[BSP]]

[[Category:Glossary]]
{{grammar checked|darth}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Category:3ds Max</title>
    <ns>14</ns>
    <id>280</id>
      <sha1>szfe2x82q5aqmjpn0e4vfunwpc4fama</sha1>
    <revision>
      <id>2805</id>
      <timestamp>2012-11-21T20:15:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds game development tools to be used with Autodesk 3D Studio max.&quot;</comment>
      <text xml:space="preserve" bytes="82">This category holds game development tools to be used with Autodesk 3D Studio max.</text>
    </revision>
    <revision>
      <id>3633</id>
      <timestamp>2013-04-09T12:07:37Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="84">This category holds game development tools to be used with Autodesk 3D Studio max.
1</text>
    </revision>
    <revision>
      <id>3635</id>
      <timestamp>2013-04-10T16:15:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="82">This category holds game development tools to be used with Autodesk 3D Studio max.</text>
    </revision>
  </page>
  <page>
    <title>Category:Adapted pages</title>
    <ns>14</ns>
    <id>196</id>
      <sha1>2twjmejn56ditxo46hqinfh52nh6flb</sha1>
    <revision>
      <id>2335</id>
      <timestamp>2012-08-01T09:01:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;__HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="13">__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Art by Adam Brown</title>
    <ns>14</ns>
    <id>434</id>
      <sha1>42xeho8tnsz6lqea9nzsix39l7fcfis</sha1>
    <revision>
      <id>3117</id>
      <timestamp>2012-11-30T09:46:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds artworks submitted by [http://brownadam.deviantart.com/ Adam Brown] [[Category:Concept art]]&quot;</comment>
      <text xml:space="preserve" bytes="112">This category holds artworks submitted by [http://brownadam.deviantart.com/ Adam Brown]
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Art by AmDDRed</title>
    <ns>14</ns>
    <id>377</id>
      <sha1>5bo0aeu324r9ysy2a7qsk7py3pk7wfy</sha1>
    <revision>
      <id>3059</id>
      <timestamp>2012-11-30T09:05:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds artworks submitted by [http://amddred.deviantart.com/ AmDDRed] [[Category:Concept art]]&quot;</comment>
      <text xml:space="preserve" bytes="107">This category holds artworks submitted by [http://amddred.deviantart.com/ AmDDRed]
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Art by David Lakatos</title>
    <ns>14</ns>
    <id>323</id>
      <sha1>ouncc4ez7gsxcj0pqna4nzeecj1lyda</sha1>
    <revision>
      <id>2995</id>
      <timestamp>2012-11-29T22:33:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds artworks submitted by [http://lakdav.deviantart.com/ David Lakatos]&quot;</comment>
      <text xml:space="preserve" bytes="87">This category holds artworks submitted by [http://lakdav.deviantart.com/ David Lakatos]</text>
    </revision>
    <revision>
      <id>3043</id>
      <timestamp>2012-11-30T08:56:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="112">This category holds artworks submitted by [http://lakdav.deviantart.com/ David Lakatos]
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Art by GamerXXL</title>
    <ns>14</ns>
    <id>393</id>
      <sha1>5p3n342oqynyaav14byf7adprb3rtwq</sha1>
    <revision>
      <id>3076</id>
      <timestamp>2012-11-30T09:20:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds artworks submitted by GamerXXL. [[Category:Concept art]]&quot;</comment>
      <text xml:space="preserve" bytes="76">This category holds artworks submitted by GamerXXL.
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Art by Hedgenok</title>
    <ns>14</ns>
    <id>427</id>
      <sha1>5i6skwr1rcw87spxrf13o3stcf1nfjb</sha1>
    <revision>
      <id>3110</id>
      <timestamp>2012-11-30T09:39:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds artworks submitted by [http://hedgenok.deviantart.com/ Pavel 'Hedgenok' Zuev] [[Category:Concept art]]&quot;</comment>
      <text xml:space="preserve" bytes="122">This category holds artworks submitted by [http://hedgenok.deviantart.com/ Pavel 'Hedgenok' Zuev]
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Art by MAD</title>
    <ns>14</ns>
    <id>585</id>
      <sha1>jynmzbpthk4s9bhoo9cnbl5waj5funl</sha1>
    <revision>
      <id>3311</id>
      <timestamp>2012-12-04T19:47:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds artworks submitted by [http://demonlife.deviantart.com/ Alexandra 'MAD' Melnikova] [[Category:Concept art]]&quot;</comment>
      <text xml:space="preserve" bytes="127">This category holds artworks submitted by [http://demonlife.deviantart.com/ Alexandra 'MAD' Melnikova]
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Article ancient</title>
    <ns>14</ns>
    <id>75</id>
      <sha1>0lc1sdgpwajg4ly0wqg3sagg5cjiat1</sha1>
    <revision>
      <id>712</id>
      <timestamp>2012-07-15T02:16:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds articles which describe very old things from previous era.&quot;</comment>
      <text xml:space="preserve" bytes="78">This category holds articles which describe very old things from previous era.</text>
    </revision>
    <revision>
      <id>737</id>
      <timestamp>2012-07-16T07:20:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="109">This category holds articles which describe [[Template:Article_ancient | very old things from previous era]].</text>
    </revision>
    <revision>
      <id>1919</id>
      <timestamp>2012-07-27T09:51:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="244">This category holds articles flagged with [[Template:Article_ancient | &lt;nowiki&gt;{{article ancient}}&lt;/nowiki&gt;]] which means they describe things from previous versions of the game.

== See also ==
[[BloodWiki:Community_portal | Community Portal]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Blood Omen characters</title>
    <ns>14</ns>
    <id>324</id>
      <sha1>titeyqitxanoc5pvcehatvexrv6xmfh</sha1>
    <revision>
      <id>2998</id>
      <timestamp>2012-11-29T22:37:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds all articles regarding enemies, civillians, captives and NPC appeared in Blood Omen: Legacy of Kain.&quot;</comment>
      <text xml:space="preserve" bytes="120">This category holds all articles regarding enemies, civillians, captives and NPC appeared in Blood Omen: Legacy of Kain.</text>
    </revision>
  </page>
  <page>
    <title>Category:Blood Omen concept art</title>
    <ns>14</ns>
    <id>426</id>
      <sha1>lj08hxut85dqo4djvhbrr6oj1ay4zyf</sha1>
    <revision>
      <id>3109</id>
      <timestamp>2012-11-30T09:36:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds concept art used in Blood Omen: Legacy of Kain production. [[Category:Concept art]]&quot;</comment>
      <text xml:space="preserve" bytes="103">This category holds concept art used in Blood Omen: Legacy of Kain production.
[[Category:Concept art]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Blood Omen enemy pictures</title>
    <ns>14</ns>
    <id>435</id>
      <sha1>mt28tle9qrjjz3q6l0naazvqemqqiju</sha1>
    <revision>
      <id>3125</id>
      <timestamp>2012-11-30T10:32:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds animated pictures of Blood Omen enemies.&quot;</comment>
      <text xml:space="preserve" bytes="60">This category holds animated pictures of Blood Omen enemies.</text>
    </revision>
  </page>
  <page>
    <title>Category:Check grammar</title>
    <ns>14</ns>
    <id>181</id>
      <sha1>huab73ci89qc83ickx3r5g10kbthn5e</sha1>
    <revision>
      <id>2173</id>
      <timestamp>2012-07-29T20:56:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds pages with [[Template:grammar | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] mark which stands for &quot;Please check grammar of the article&quot;.  If you are looking at contribu...&quot;</comment>
      <text xml:space="preserve" bytes="246">This category holds pages with [[Template:grammar | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] mark which stands for &quot;Please check grammar of the article&quot;.

If you are looking at contributing to the Blood Wiki, checking and fixing this pages are good choice.</text>
    </revision>
    <revision>
      <id>2250</id>
      <timestamp>2012-07-30T20:16:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="261">This category holds pages with [[Template:grammar | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] mark which stands for &quot;Please check grammar of the article&quot;.

If you are looking at contributing to the Blood Wiki, checking and fixing this pages are good choice.

__HIDDENCAT__</text>
    </revision>
    <revision>
      <id>2702</id>
      <timestamp>2012-09-28T13:24:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="246">This category holds pages with [[Template:grammar | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] mark which stands for &quot;Please check grammar of the article&quot;.

If you are looking at contributing to the Blood Wiki, checking and fixing this pages are good choice.</text>
    </revision>
    <revision>
      <id>2703</id>
      <timestamp>2012-09-28T13:26:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="261">This category holds pages with [[Template:grammar | &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;]] mark which stands for &quot;Please check grammar of the article&quot;.

If you are looking at contributing to the Blood Wiki, checking and fixing this pages are good choice.

__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Concept art</title>
    <ns>14</ns>
    <id>322</id>
      <sha1>1p7u2art30xij9mhceaiphrls0gxd8y</sha1>
    <revision>
      <id>2994</id>
      <timestamp>2012-11-29T22:32:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds concept art used by Blood Omnicide.&quot;</comment>
      <text xml:space="preserve" bytes="55">This category holds concept art used by Blood Omnicide.</text>
    </revision>
    <revision>
      <id>3060</id>
      <timestamp>2012-11-30T09:15:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="274">This category holds concept art used by Blood Omnicide.

Being community-supported project, Blood Omnicide uses concept art as 'cover-your-ideas' thing. There is artwork good enough to be used for production. Other arts can be used as inspiration to produce better artworks.</text>
    </revision>
  </page>
  <page>
    <title>Category:Darkplaces engine</title>
    <ns>14</ns>
    <id>205</id>
      <sha1>lq1cjdoec0ebcp3tlkf7cgunxyf5n5r</sha1>
    <revision>
      <id>2402</id>
      <timestamp>2012-08-03T06:46:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds all pages giving an info about features, terminology or techniques used in [[Darkplaces engine]].&quot;</comment>
      <text xml:space="preserve" bytes="117">This category holds all pages giving an info about features, terminology or techniques used in [[Darkplaces engine]].</text>
    </revision>
    <revision>
      <id>2403</id>
      <timestamp>2012-08-03T06:47:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="81">This category holds all articles about anything related to [[Darkplaces engine]].</text>
    </revision>
  </page>
  <page>
    <title>Category:Entity definitions</title>
    <ns>14</ns>
    <id>31</id>
      <sha1>0fcbh5b8798wbb8q0ljge37u98x9fla</sha1>
    <revision>
      <id>330</id>
      <timestamp>2012-07-03T22:24:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Entity classes that can be used in level editor.&quot;</comment>
      <text xml:space="preserve" bytes="48">Entity classes that can be used in level editor.</text>
    </revision>
    <revision>
      <id>357</id>
      <timestamp>2012-07-06T20:53:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="52">[[Entity classes]] that can be used in level editor.</text>
    </revision>
  </page>
  <page>
    <title>Category:Entity templates</title>
    <ns>14</ns>
    <id>77</id>
      <sha1>7u5i3427m1eeefvjbj65lhvy1ecelf7</sha1>
    <revision>
      <id>775</id>
      <timestamp>2012-07-16T08:22:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds templates used at entity definition pages.&quot;</comment>
      <text xml:space="preserve" bytes="62">This category holds templates used at entity definition pages.</text>
    </revision>
    <revision>
      <id>777</id>
      <timestamp>2012-07-16T08:51:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="86">This category holds templates used at entity definition pages.

[[Category:Templates]]</text>
    </revision>
  </page>
  <page>
    <title>Category:File formats</title>
    <ns>14</ns>
    <id>5</id>
      <sha1>i124uj8ne8qulioumhhtvczpxrtthtj</sha1>
    <revision>
      <id>36</id>
      <timestamp>2012-07-02T13:49:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category groups all articlea about file formats used in Blood Omnicide.&quot;</comment>
      <text xml:space="preserve" bytes="76">This category groups all articlea about file formats used in Blood Omnicide.</text>
    </revision>
    <revision>
      <id>3418</id>
      <timestamp>2013-01-22T14:32:58Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="76">This category groups all articles about file formats used in Blood Omnicide.</text>
    </revision>
  </page>
  <page>
    <title>Category:Finished pages</title>
    <ns>14</ns>
    <id>184</id>
      <sha1>2twjmejn56ditxo46hqinfh52nh6flb</sha1>
    <revision>
      <id>2203</id>
      <timestamp>2012-07-30T05:40:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;__HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="13">__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Formatting templates</title>
    <ns>14</ns>
    <id>71</id>
      <sha1>9r8ca3x2t4nsjpzjmppm2o5limsvg2w</sha1>
    <revision>
      <id>669</id>
      <timestamp>2012-07-15T01:49:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds common formatting templates to be used on articles.  [[Category:Templates]]&quot;</comment>
      <text xml:space="preserve" bytes="95">This category holds common formatting templates to be used on articles.

[[Category:Templates]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Glossary</title>
    <ns>14</ns>
    <id>52</id>
      <sha1>ce52ow4sob19c1a5e11084fsfvqrhsa</sha1>
    <revision>
      <id>434</id>
      <timestamp>2012-07-14T19:48:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This group holds editing terminology&quot;</comment>
      <text xml:space="preserve" bytes="36">This group holds editing terminology</text>
    </revision>
  </page>
  <page>
    <title>Category:Grammar checked</title>
    <ns>14</ns>
    <id>204</id>
      <sha1>2twjmejn56ditxo46hqinfh52nh6flb</sha1>
    <revision>
      <id>2386</id>
      <timestamp>2012-08-02T16:36:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;__HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="13">__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Imported pages</title>
    <ns>14</ns>
    <id>198</id>
      <sha1>2twjmejn56ditxo46hqinfh52nh6flb</sha1>
    <revision>
      <id>2337</id>
      <timestamp>2012-08-01T09:06:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;__HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="13">__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian</title>
    <ns>14</ns>
    <id>622</id>
      <sha1>61kl3az2lz52v6pp6peuygce2n63ubm</sha1>
    <revision>
      <id>3481</id>
      <timestamp>2013-01-22T19:26:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds all pages of [[Portal:InItalian|Blood Wiki in Italian Portal]] __HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="96">This category holds all pages of [[Portal:InItalian|Blood Wiki in Italian Portal]]
__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian/Formati dei file</title>
    <ns>14</ns>
    <id>636</id>
      <sha1>i56myuihnehloc02wjji3yqp3hmzqew</sha1>
    <revision>
      <id>3538</id>
      <timestamp>2013-01-24T18:10:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Questa categoria raggruppa tutti gli articoli che parlano dei formati di file usati in Blood Omnicide. {{initalian|Categoria:Formati dei file}}&quot;</comment>
      <text xml:space="preserve" bytes="143">Questa categoria raggruppa tutti gli articoli che parlano dei formati di file usati in Blood Omnicide.
{{initalian|Categoria:Formati dei file}}</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian/Glossario</title>
    <ns>14</ns>
    <id>619</id>
      <sha1>4dhfa43a24rabucwsd0nihw0l1aou39</sha1>
    <revision>
      <id>3466</id>
      <timestamp>2013-01-22T19:08:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;In questa categoria è elencata tutta la terminologia tecnica per la creazione del gioco. {{initalian|Categoria:Glossario}}&quot;</comment>
      <text xml:space="preserve" bytes="123">In questa categoria è elencata tutta la terminologia tecnica per la creazione del gioco.
{{initalian|Categoria:Glossario}}</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian/Motore grafico DarkPlaces</title>
    <ns>14</ns>
    <id>650</id>
      <sha1>gw9udn9r3wfldt3i5jbubhmzht5hrj4</sha1>
    <revision>
      <id>3617</id>
      <timestamp>2013-03-23T18:14:12Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;In questa categoria sono raggruppati tutti gli articoli che hanno a che fare con il motore di gioco DarkPlaces. {{initalian|Categoria:Motore grafico DarkPlaces}}&quot;</comment>
      <text xml:space="preserve" bytes="161">In questa categoria sono raggruppati tutti gli articoli che hanno a che fare con il motore di gioco DarkPlaces.
{{initalian|Categoria:Motore grafico DarkPlaces}}</text>
    </revision>
    <revision>
      <id>3623</id>
      <timestamp>2013-03-23T18:29:59Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="211">In questa categoria sono raggruppati tutti gli articoli che hanno a che fare con il [[Portal:InItalian/Il_motore_grafico_DarkPlaces|motore di gioco DarkPlaces]].
{{initalian|Categoria:Motore grafico DarkPlaces}}</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian/Oggetti</title>
    <ns>14</ns>
    <id>618</id>
      <sha1>slwx6otfkjzu8stnbmzmuqnjc1scdrv</sha1>
    <revision>
      <id>3464</id>
      <timestamp>2013-01-22T19:06:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Categoria di tutti gli oggetti che possono essere trovati durante il gioco. {{initalian|Categoria:Oggetti}}&quot;</comment>
      <text xml:space="preserve" bytes="107">Categoria di tutti gli oggetti che possono essere trovati durante il gioco.
{{initalian|Categoria:Oggetti}}</text>
    </revision>
    <revision>
      <id>3494</id>
      <timestamp>2013-01-24T12:22:57Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="108">Categoria di tutti gli oggetti che possono essere trovati durante il gioco.
{{initalian|Categoria: Oggetti}}</text>
    </revision>
    <revision>
      <id>3495</id>
      <timestamp>2013-01-24T12:23:16Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="107">Categoria di tutti gli oggetti che possono essere trovati durante il gioco.
{{initalian|Categoria:Oggetti}}</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian/Personaggi di Blood Omen</title>
    <ns>14</ns>
    <id>620</id>
      <sha1>i5wqxbl2bfclrv8azs1lzujxyhg0xii</sha1>
    <revision>
      <id>3467</id>
      <timestamp>2013-01-22T19:11:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Questa categoria contiene tutti gli articoli riguardanti nemici, civili, prigionieri e NPC che appaiono in Blood Omen: Legacy of Kain. {{initalian|Categoria: Personaggi di Blo...&quot;</comment>
      <text xml:space="preserve" bytes="184">Questa categoria contiene tutti gli articoli riguardanti nemici, civili, prigionieri e NPC che appaiono in Blood Omen: Legacy of Kain.
{{initalian|Categoria: Personaggi di Blood Omen}}</text>
    </revision>
    <revision>
      <id>3496</id>
      <timestamp>2013-01-24T12:23:21Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="183">Questa categoria contiene tutti gli articoli riguardanti nemici, civili, prigionieri e NPC che appaiono in Blood Omen: Legacy of Kain.
{{initalian|Categoria:Personaggi di Blood Omen}}</text>
    </revision>
  </page>
  <page>
    <title>Category:InItalian/Templates</title>
    <ns>14</ns>
    <id>614</id>
      <sha1>f4i3yk62iwyma29vey7bec07urm7fg2</sha1>
    <revision>
      <id>3448</id>
      <timestamp>2013-01-22T18:18:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Template da usare nel portale [[Portal:InItalian|italiano di Blood Wiki]].&quot;</comment>
      <text xml:space="preserve" bytes="74">Template da usare nel portale [[Portal:InItalian|italiano di Blood Wiki]].</text>
    </revision>
    <revision>
      <id>3480</id>
      <timestamp>2013-01-22T19:25:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="118">Template da usare nel portale [[Portal:InItalian|italiano di Blood Wiki]].
{{initalian|Categoria:InItalian/Templates}}</text>
    </revision>
  </page>
  <page>
    <title>Category:InRussian</title>
    <ns>14</ns>
    <id>623</id>
      <sha1>dnldwvpqz0phqh8rebipu6xrmn962dc</sha1>
    <revision>
      <id>3482</id>
      <timestamp>2013-01-22T19:30:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds all pages for [[Portal:InRussian|Blood Wiki in Russian]] Portal. __HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="98">This category holds all pages for [[Portal:InRussian|Blood Wiki in Russian]] Portal.
__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Items</title>
    <ns>14</ns>
    <id>34</id>
      <sha1>byp0qjrnm90qoakl1ohia239vlr4612</sha1>
    <revision>
      <id>342</id>
      <timestamp>2012-07-03T22:34:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Items are objects that could be picked.&quot;</comment>
      <text xml:space="preserve" bytes="39">Items are objects that could be picked.</text>
    </revision>
  </page>
  <page>
    <title>Category:Need screenshot</title>
    <ns>14</ns>
    <id>175</id>
      <sha1>mr0w1xxo7pwvhwhsg4xwxkx9x9wckx4</sha1>
    <revision>
      <id>2039</id>
      <timestamp>2012-07-27T15:08:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds pages marked [[Template:WIP | &lt;nowiki&gt;{{need screenshot}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Co...&quot;</comment>
      <text xml:space="preserve" bytes="192">This category holds pages marked [[Template:WIP | &lt;nowiki&gt;{{need screenshot}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Community Portal]].</text>
    </revision>
    <revision>
      <id>2040</id>
      <timestamp>2012-07-27T15:08:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="204">This category holds pages marked [[Template:need screenshot | &lt;nowiki&gt;{{need screenshot}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Community Portal]].</text>
    </revision>
    <revision>
      <id>2247</id>
      <timestamp>2012-07-30T20:11:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="219">This category holds pages marked [[Template:need screenshot | &lt;nowiki&gt;{{need screenshot}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Community Portal]].

__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Outdated pages</title>
    <ns>14</ns>
    <id>171</id>
      <sha1>it3cjna60hwkrxyys11dsxyxglx12op</sha1>
    <revision>
      <id>2019</id>
      <timestamp>2012-07-27T14:30:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds pages with [[Template:unfinished | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] mark.  If you are looking at contributing to the Blood Wiki, bringing &quot;outdated pages&quot; i...&quot;</comment>
      <text xml:space="preserve" bytes="225">This category holds pages with [[Template:unfinished | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] mark.

If you are looking at contributing to the Blood Wiki, bringing &quot;outdated pages&quot; in sync with current project state are good choice.</text>
    </revision>
    <revision>
      <id>2020</id>
      <timestamp>2012-07-27T14:31:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="223">This category holds pages with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] mark.

If you are looking at contributing to the Blood Wiki, bringing &quot;outdated pages&quot; in sync with current project state are good choice.</text>
    </revision>
    <revision>
      <id>2235</id>
      <timestamp>2012-07-30T20:00:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="238">This category holds pages with [[Template:outdated | &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;]] mark.

If you are looking at contributing to the Blood Wiki, bringing &quot;outdated pages&quot; in sync with current project state are good choice.

__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Page marks</title>
    <ns>14</ns>
    <id>169</id>
      <sha1>5gcqzh0xzt1bl8pjv38lj2dtxqiz2mk</sha1>
    <revision>
      <id>2013</id>
      <timestamp>2012-07-27T14:25:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Page marks are special templates used to flag pages with some messages. Like &lt;nowiki&gt;{{unfinished}&lt;/nowiki&gt; will post message that this page is unfinished and will show in &quot;Un...&quot;</comment>
      <text xml:space="preserve" bytes="271">Page marks are special templates used to flag pages with some messages. Like &lt;nowiki&gt;{{unfinished}&lt;/nowiki&gt; will post message that this page is unfinished and will show in &quot;Unfinished Pages&quot; section on [[BloodWiki:Community | BloodWiki Community]]

[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>2033</id>
      <timestamp>2012-07-27T14:52:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="283">Page marks are special templates used to flag pages with some messages. Like &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt; mark will set a message that this page is unfinished and will show it in &quot;Unfinished Pages&quot; section in[[BloodWiki:Community portal| Community portal]]

[[Category:Templates]]</text>
    </revision>
  </page>
  <page>
    <title>Category:Special templates</title>
    <ns>14</ns>
    <id>318</id>
      <sha1>kdacit2xy3m9ib4mblcb04hyqcqj81d</sha1>
    <revision>
      <id>2954</id>
      <timestamp>2012-11-29T21:27:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Special templates are used to assist with formatting of certain pages. They are only applicable to page kinds they was created for.&quot;</comment>
      <text xml:space="preserve" bytes="131">Special templates are used to assist with formatting of certain pages. They are only applicable to page kinds they was created for.</text>
    </revision>
  </page>
  <page>
    <title>Category:Templates</title>
    <ns>14</ns>
    <id>53</id>
      <sha1>5gw9jnygobnkvly93bpfsqx0x512p5d</sha1>
    <revision>
      <id>437</id>
      <timestamp>2012-07-14T19:51:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds all templates&quot;</comment>
      <text xml:space="preserve" bytes="33">This category holds all templates</text>
    </revision>
    <revision>
      <id>2163</id>
      <timestamp>2012-07-29T14:15:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="105">This category holds all templates to be used in pages. For convenience all templates are sub-categorized.</text>
    </revision>
  </page>
  <page>
    <title>Category:Tools</title>
    <ns>14</ns>
    <id>283</id>
      <sha1>84onclxl3epi0p6kqsxgyhyduuph4wx</sha1>
    <revision>
      <id>2813</id>
      <timestamp>2012-11-21T20:49:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds all tools used in development of Blood Omnicide.&quot;</comment>
      <text xml:space="preserve" bytes="68">This category holds all tools used in development of Blood Omnicide.</text>
    </revision>
  </page>
  <page>
    <title>Category:Unfinished pages</title>
    <ns>14</ns>
    <id>167</id>
      <sha1>5dv2zqdm0w4bpxtiiki9b7dfemdv0s6</sha1>
    <revision>
      <id>2004</id>
      <timestamp>2012-07-27T14:03:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds pages with [[Template:Article_unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] page brick.  If you are looking at adding something to Wiki, unfinished articl...&quot;</comment>
      <text xml:space="preserve" bytes="199">This category holds pages with [[Template:Article_unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] page brick.

If you are looking at adding something to Wiki, unfinished articles are first candidates.</text>
    </revision>
    <revision>
      <id>2005</id>
      <timestamp>2012-07-27T14:03:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="191">This category holds pages with [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] page brick.

If you are looking at adding something to Wiki, unfinished articles are first candidates.</text>
    </revision>
    <revision>
      <id>2017</id>
      <timestamp>2012-07-27T14:29:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="185">This category holds pages with [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] mark.

If you are looking at adding something to Wiki, unfinished articles are first candidates.</text>
    </revision>
    <revision>
      <id>2018</id>
      <timestamp>2012-07-27T14:29:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="195">This category holds pages with [[Template:unfinished | &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;]] mark.

If you are looking at contributing to the Blood Wiki, finishing &quot;unfinished pages&quot; are good choice.</text>
    </revision>
    <revision>
      <id>2234</id>
      <timestamp>2012-07-30T20:00:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Replaced content with &quot;__HIDDENCAT__&quot;</comment>
      <text xml:space="preserve" bytes="13">__HIDDENCAT__</text>
    </revision>
  </page>
  <page>
    <title>Category:Work-In-Progress pages</title>
    <ns>14</ns>
    <id>170</id>
      <sha1>jcpvgvu7v60kpvn7m43omn2hjc56exp</sha1>
    <revision>
      <id>2015</id>
      <timestamp>2012-07-27T14:28:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;This category holds pages marked [[Template:WIP | &lt;nowiki&gt;{{WIP}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Community Port...&quot;</comment>
      <text xml:space="preserve" bytes="453">This category holds pages marked [[Template:WIP | &lt;nowiki&gt;{{WIP}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Community Portal]].

WIP stands for Work-In-Progress. User mark article with this if he is working on significant changes and want no one to edit a page.

Some users forgot their WIP pages however, so if you are see page with WIP mark and it wasnt edited more than 2 weeks, you can unflag it.</text>
    </revision>
    <revision>
      <id>2031</id>
      <timestamp>2012-07-27T14:48:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="461">This category holds pages marked [[Template:WIP | &lt;nowiki&gt;{{WIP}}&lt;/nowiki&gt;]]. This allows pages to show up in special category in [[BloodWiki:Community_portal | Community Portal]].

WIP stands for Work-In-Progress. User mark article with this if he is working on significant changes and want no one to edit a page.

Some users forgot their WIP pages however, so if you are see page with WIP mark and it wasnt edited more than 2 weeks, you can remove a WIP mark.</text>
    </revision>
  </page>
  <page>
    <title>Cave abomination</title>
    <ns>0</ns>
    <id>321</id>
      <sha1>k57z8m4he8vps58x0l5xk6arjdqd15p</sha1>
    <revision>
      <id>2993</id>
      <timestamp>2012-11-29T22:31:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Ugly monster that throws sluggish substance bolts. Making it's first appear in Oracle of Nosgoth mountain. {{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|...&quot;</comment>
      <text xml:space="preserve" bytes="269">Ugly monster that throws sluggish substance bolts. Making it's first appear in Oracle of Nosgoth mountain.
{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|green|enemy_cave_abomination|gallery=
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;
}}</text>
    </revision>
    <revision>
      <id>3000</id>
      <timestamp>2012-11-29T22:40:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="274">Ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.
{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|green|enemy_cave_abomination|gallery=
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;
}}</text>
    </revision>
    <revision>
      <id>3001</id>
      <timestamp>2012-11-29T22:42:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Blood Omen/Characters/Cave abomination]] to [[Cave abomination]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="274">Ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.
{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|green|enemy_cave_abomination|gallery=
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;
}}</text>
    </revision>
    <revision>
      <id>3118</id>
      <timestamp>2012-11-30T10:10:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="309">Ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.
{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|green|enemy_cave_abomination|gallery=
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;
}}
Back to: [[Blood Omen Characters]]</text>
    </revision>
    <revision>
      <id>3119</id>
      <timestamp>2012-11-30T10:11:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="309">Ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.
{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|green|enemy_cave_abomination|gallery=
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;
}}
Back to: [[Blood Omen characters]]</text>
    </revision>
    <revision>
      <id>3123</id>
      <timestamp>2012-11-30T10:13:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="274">Ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.
{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination|12|5|green|enemy_cave_abomination|gallery=
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;
}}</text>
    </revision>
    <revision>
      <id>3276</id>
      <timestamp>2012-11-30T11:22:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="412">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination}}
Cave abonination - ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.

==Stats==

:Health: 12
:Damage: 5 per bolt
:Blood: green
:Walk speed: medium
:Character type: animal
:Entity: [[enemy_cave_abomination]]

==Concept art gallery==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;</text>
    </revision>
    <revision>
      <id>3277</id>
      <timestamp>2012-11-30T11:23:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="431">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination}}
Cave abonination - ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth mountain.

==Stats==

:Health: 12
:Damage: 5 per bolt
:Blood: green
:Walk speed: medium
:Character type: animal
:Entity: [[enemy_cave_abomination]]

==Concept art gallery==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3278</id>
      <timestamp>2012-11-30T11:24:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="428">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination}}
Cave abomination - ugly monster that throws bolts of some dirty substance. Making it's first appear in Oracle of Nosgoth caves.

==Stats==

:Health: 12
:Damage: 5 per bolt
:Blood: green
:Walk speed: medium
:Character type: animal
:Entity: [[enemy_cave_abomination]]

==Concept art gallery==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Cave beast</title>
    <ns>0</ns>
    <id>586</id>
      <sha1>1v9yfjj2wizg8hh77rn6gkdvp0bqna5</sha1>
    <revision>
      <id>3312</id>
      <timestamp>2012-12-07T19:13:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Cave beast}} A mix of wolf and sloth encountered in oracle's caves and other cave-like locations. There is two variations of monster - br...&quot;</comment>
      <text xml:space="preserve" bytes="617">{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Cave beast}}
A mix of wolf and sloth encountered in oracle's caves and other cave-like locations. There is two variations of monster - brown-colored and purple-colored, the differense is damage of melee attack and health amount. Moves clumsily, but fast. Melee attack is slow and can be easily avoided.

==Stats==

:Health: 15 / 30
:Damage: 25 / 35
:Blood: red
:Walk speed: high
:Character type: animal
:Entity: [[enemy_cave_beast]], [[enemy_cave_beast2]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3315</id>
      <timestamp>2012-12-07T19:29:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="680">{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Cold cave beast}}
{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Cave beast}}
A mix of wolf and sloth encountered in oracle's caves and other cave-like locations. There is two variations of monster - brown-colored and purple-colored, the differense is damage of melee attack and health amount. Moves clumsily, but fast. Melee attack is slow and can be easily avoided.

==Stats==

:Health: 15 / 30
:Damage: 25 / 35
:Blood: red
:Walk speed: high
:Character type: animal
:Entity: [[enemy_cave_beast]], [[enemy_cave_beast2]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3316</id>
      <timestamp>2012-12-07T19:37:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="674">{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Cold cave beast}}
{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Cave beast}}
A mix of wolf and sloth encountered in oracle's caves and cold outdoor plains. There is two variations of monster - brown-colored and purple-colored, the difference is damage of melee attack and health amount. Moves clumsily, but fast. Melee attack is slow and can be easily avoided.

==Stats==

:Health: 15 / 30
:Damage: 25 / 35
:Blood: red
:Walk speed: high
:Character type: animal
:Entity: [[enemy_cave_beast]], [[enemy_cave_beast2]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>ChangeLog:Blood Omnicide</title>
    <ns>0</ns>
    <id>311</id>
      <sha1>kq83p6ojycz9s95s24qomn6fv22hpk1</sha1>
    <revision>
      <id>2908</id>
      <timestamp>2012-11-23T01:50:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Blood Omnicide SVN change log}} {{#svnchanges:omnicide:trunk}}&quot;</comment>
      <text xml:space="preserve" bytes="77">{{DISPLAYTITLE:Blood Omnicide SVN change log}}
{{#svnchanges:omnicide:trunk}}</text>
    </revision>
    <revision>
      <id>2910</id>
      <timestamp>2012-11-23T03:08:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="234">{{DISPLAYTITLE:Blood Omnicide SVN change log}}
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;</text>
    </revision>
  </page>
  <page>
    <title>Common materials</title>
    <ns>0</ns>
    <id>89</id>
      <sha1>bv64s9h7u1lzjte1vohqsizwg9onjln</sha1>
    <revision>
      <id>872</id>
      <timestamp>2012-07-16T18:58:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{article unfinished}}  Caulk  A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player...&quot;</comment>
      <text xml:space="preserve" bytes="212">{{article unfinished}}

Caulk

A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.</text>
    </revision>
    <revision>
      <id>930</id>
      <timestamp>2012-07-16T20:05:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="604">{{article unfinished}}

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| width=8% | [[File:common_caulk.jpg|64px]]
| width=92% | '''Caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|}



Caulk

A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.</text>
    </revision>
    <revision>
      <id>932</id>
      <timestamp>2012-07-16T20:43:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3806">System materials with a special behavior. Used widely on all maps.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| width=8% | [[File:common_caulk.jpg|64px]]
| width=92% | '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}

== Special ==

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthill.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

== Unused ===

This materials are there, but not having any functionality.</text>
    </revision>
    <revision>
      <id>933</id>
      <timestamp>2012-07-16T20:46:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4281">System materials with a special behavior. Used widely on all maps.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| width=8% | [[File:common_caulk.jpg|64px]]
| width=92% | '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but not having any functionality.</text>
    </revision>
    <revision>
      <id>936</id>
      <timestamp>2012-07-16T20:50:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4510">System materials with a special behavior. Used widely on all maps.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| width=8% | [[File:common_caulk.jpg|64px]]
| width=92% | '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>937</id>
      <timestamp>2012-07-16T20:50:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4511">System materials with a special behavior. Used widely on all maps.

{| width=1024 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| width=8% | [[File:common_caulk.jpg|64px]]
| width=92% | '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>938</id>
      <timestamp>2012-07-16T20:51:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4478">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=70 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>939</id>
      <timestamp>2012-07-16T20:51:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4478">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=60 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>940</id>
      <timestamp>2012-07-16T20:51:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4478">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=68 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>941</id>
      <timestamp>2012-07-16T20:51:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4478">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system shader designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Surfaces with this shaders make invisible walls which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Like Clip but only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>942</id>
      <timestamp>2012-07-16T20:52:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4442">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only clips NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>943</id>
      <timestamp>2012-07-16T20:52:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4436">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damage the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damage at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>944</id>
      <timestamp>2012-07-16T20:53:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4438">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), almost impossible to walk.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>945</id>
      <timestamp>2012-07-16T20:53:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4438">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint''
This brush splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>946</id>
      <timestamp>2012-07-16T20:53:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Rarely used materials */</comment>
      <text xml:space="preserve" bytes="4448">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| width=800 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>947</id>
      <timestamp>2012-07-16T20:55:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4430">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

== Unused ===

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>948</id>
      <timestamp>2012-07-16T20:55:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4425">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


= Markers =

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials to mark various stuff, like light glares, zones.
|}

= Unused =

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>949</id>
      <timestamp>2012-07-16T20:56:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4446">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


= Rarely used materials =

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}


= Markers =

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

= Unused =

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>950</id>
      <timestamp>2012-07-16T20:56:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4475">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}

{{hidden start | Rarely used materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


= Markers =

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

= Unused =

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>951</id>
      <timestamp>2012-07-16T20:57:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4475">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}

{{hidden begin | Rarely used materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


= Markers =

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

= Unused =

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>952</id>
      <timestamp>2012-07-16T20:57:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4483">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


= Markers =

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

= Unused =

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>1058</id>
      <timestamp>2012-07-17T20:40:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4487">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Splits visibility data making more portals. Rarely used to enhance portal culling.
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>1399</id>
      <timestamp>2012-07-22T18:24:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4689">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>1400</id>
      <timestamp>2012-07-22T18:50:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4811">System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).

Player clip is often useful for &quot;smoothing&quot; out the geometry of the map, preventing the player from snagging on objects.
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>2157</id>
      <timestamp>2012-07-29T14:08:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4832">{{need screenshot}}

System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).

Player clip is often useful for &quot;smoothing&quot; out the geometry of the map, preventing the player from snagging on objects.
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>2302</id>
      <timestamp>2012-07-30T21:53:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4847">{{unfinished}}
{{need screenshot}}

System materials with a special behavior. Used widely on all maps.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. This texture generate no draw surfaces.
|-
| [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).

Player clip is often useful for &quot;smoothing&quot; out the geometry of the map, preventing the player from snagging on objects.
|-
| [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}


{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_skip.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>2516</id>
      <timestamp>2012-08-09T09:52:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6119">{{unfinished}}
{{need screenshot}}

Common materials are system textures with a special behavior assigned to them. Thay are used to assist level designer in many tasks.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. Caulk will block [[VIS]], so it can seal you map from a void.
{{tip|When you build a [[BModel|brush entity]], mark all the brush sides that you will never see with caulk. Otherwise, the game draws every one of them. Also look around your map for brush faces that you suspect are being drawn, but are never seen: door pockets, bars, underneath bridges or very low railings and so on. It may sound like work, but attention to detail like this buys you both the appearance of greater geometric detail in the map AND faster game running speed.}}
|-
| valign=top | [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Non-solid, invisible texture. Just like caulk but additionally it do not block player movement and not making VIS splits.
|-
| valign=top | [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).

Player clip is often useful for &quot;smoothing&quot; out the geometry of the map, preventing the player from snagging on objects.
|-
| valign=top | [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| valign=top | [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| valign=top | [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| valign=top | [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| valign=top | [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| valign=top | [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| valign=top | [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| valign=top | [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| valign=top | [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}

{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| valign=top | [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| valign=top | [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| valign=top | [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| valign=top | [[File:common_skip.jpg|64px]]
| '''common/skip'''
This special textures should be used only on hint brushes (see above for hint texture). Surfaces with this texture will not make VIS splits (so, they are just skipped).
|-
| valign=top | [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| valign=top | [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| valign=top | [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| valign=top | [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>2517</id>
      <timestamp>2012-08-09T09:52:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6065">{{unfinished}}
{{need screenshot}}

Common materials are system textures with a special behavior assigned to them.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game. Caulk will block [[VIS]], so it can seal you map from a void.
{{tip|When you build a [[BModel|brush entity]], mark all the brush sides that you will never see with caulk. Otherwise, the game draws every one of them. Also look around your map for brush faces that you suspect are being drawn, but are never seen: door pockets, bars, underneath bridges or very low railings and so on. It may sound like work, but attention to detail like this buys you both the appearance of greater geometric detail in the map AND faster game running speed.}}
|-
| valign=top | [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Non-solid, invisible texture. Just like caulk but additionally it do not block player movement and not making VIS splits.
|-
| valign=top | [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).

Player clip is often useful for &quot;smoothing&quot; out the geometry of the map, preventing the player from snagging on objects.
|-
| valign=top | [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| valign=top | [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| valign=top | [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| valign=top | [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| valign=top | [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| valign=top | [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| valign=top | [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| valign=top | [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| valign=top | [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}

{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| valign=top | [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| valign=top | [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| valign=top | [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| valign=top | [[File:common_skip.jpg|64px]]
| '''common/skip'''
This special textures should be used only on hint brushes (see above for hint texture). Surfaces with this texture will not make VIS splits (so, they are just skipped).
|-
| valign=top | [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| valign=top | [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| valign=top | [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| valign=top | [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
    <revision>
      <id>2518</id>
      <timestamp>2012-08-09T09:53:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6066">{{unfinished}}
{{need screenshot}}

Common materials are system textures with a special behavior assigned to them.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_caulk.jpg|64px]]
| '''common/caulk'''
A system material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.

Caulk will block [[VIS]], so it can seal you map from a void.
{{tip|When you build a [[BModel|brush entity]], mark all the brush sides that you will never see with caulk. Otherwise, the game draws every one of them. Also look around your map for brush faces that you suspect are being drawn, but are never seen: door pockets, bars, underneath bridges or very low railings and so on. It may sound like work, but attention to detail like this buys you both the appearance of greater geometric detail in the map AND faster game running speed.}}
|-
| valign=top | [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Non-solid, invisible texture. Just like caulk but additionally it do not block player movement and not making VIS splits.
|-
| valign=top | [[File:common_clip.jpg|64px]]
| '''common/clip'''
Invisible material which clips movement of players. Do not affects footsteps (footstep tracing skips clipsurfaces to get real material player standing on).

Player clip is often useful for &quot;smoothing&quot; out the geometry of the map, preventing the player from snagging on objects.
|-
| valign=top | [[File:common_monsterclip.jpg|64px]]
| '''common/monsterclip'''
Clip only NPC movement.
|-
| valign=top | [[File:common_fullclip.jpg|64px]]
| '''common/fullclip'''
PlayerClip + MonsterClip.
|-
| valign=top | [[File:common_origin.jpg|64px]]
| '''common/origin'''
Normally brush entities have no origin. Center of brush covered by this textures will set origin of it's parent [[BModel]]. This origin is used for movement (path spots) and rotation.
|-
| valign=top | [[File:common_black.jpg|64px]]
| '''common/black'''
Black wall, hides any stuff behing it. Dont cast a shadow.
|-
| valign=top | [[File:common_areadisable.jpg|64px]]
| '''common/areadisable'''
Black wall on steroids, this also hides any transparent entities, marks, effects.
|-
| valign=top | [[File:common_iwater.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to water. Also used on covering junction sides of water brushes (when making a long river). Water damages the player at slight rate.
|-
| valign=top | [[File:common_islime.jpg|64px]]
| '''common/islime'''
Invisible, sets brush contents to swamp. Swamp slows down player and damages at slight rate when he moves.
|-
| valign=top | [[File:common_ilava.jpg|64px]]
| '''common/ilava'''
Invisible, sets brush contents to lava. Also used on covering junction sides of lava brushes. Lava damages player at hight rate (even in mist form), very dangerous to walk on.
|-
| valign=top | [[File:common_lightgrid.jpg|64px]]
| '''common/lightgrid'''
World brush with this texture will make boundaries of [[lightgrid | entity static lighting]]. There is no other use.
|}

{{hidden begin | Rarely used common materials}}

This system materials used to create very special things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_blackshadow.jpg|64px]]
| '''common/blackshadow'''
Black wall but casts shadows from static lights.
|-
| valign=top | [[File:common_lightblock.jpg|64px]]
| '''common/lightblock'''
Invisible surface that blocks lighting.
|-
| valign=top | [[File:common_lighthull.jpg|64px]]
| '''common/lighthull'''
Same as lightblock but blocks lighting from inside.
|-
| valign=top | [[File:common_hint.jpg|64px]]
| '''common/hint'''
Invisible material. Brush marked with this texture will create a portal in visibility tree. Rarely used on the places where general portal creation algorithm was failed to generate a proper vis portals, which caused a game slowdown. See [[Darkplaces_material_system#surfaceparm hint | surfaceparm hint]].
|-
| valign=top | [[File:common_skip.jpg|64px]]
| '''common/skip'''
This special textures should be used only on hint brushes (see above for hint texture). Surfaces with this texture will not make VIS splits (so, they are just skipped).
|-
| valign=top | [[File:common_nodraw.jpg|64px]]
| '''common/nodraw'''
Caulk that doesnt block visibility data.
|-
| valign=top | [[File:common_dpshadow.jpg|64px]]
| '''common/dpshadow'''
Invisible wall that cast realtime shadows. Weird.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihclip'''
This invisible texture is inaccessible from texture window. It is ised on [[collision mesh | collision meshes]] to define [[BIH]] support with no reatime shadows.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihplayerclip'''
[[BIH]] support + playerclip.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''dpbihclipandshadow'''
[[BIH]] support + cast realtime shadows.
|-
| valign=top | [[File:common_collision.jpg|64px]]
| '''collision'''
This texture should be used with &quot;collision&quot; mesh only used by [[ODE]].
|}
{{hidden end}}


== Markers ==

This materials dont have any effects. Thay are just used to separate things.

{| cellspacing=0 cellpadding=8 border=0 style=&quot;border-collapse: collapse&quot;
| width=64 valign=top | [[File:common_trigger.jpg|64px]]
| '''common/trigger'''
All triggers should be marked with this material.
|-
| valign=top | [[File:common_roof.jpg|64px]]
| '''common/roof'''
Material to cover invisible rooftops on [[func_roof]].
|-
| valign=top | [[File:common_mark.jpg|64px]]
| '''common/mark1''' ... '''common/mark9'''
Visible materials with different color to mark various stuff, like light glares, zones.
|}

== Unused ==

This materials are there, but have no functionality.

{| width=256 height=32 cellspacing=0 cellpadding=7 border=0 style=&quot;border-collapse: collapse&quot;
| [[File:common_antiportal.jpg|64px]]
| [[File:common_nodrop.jpg|64px]]
| [[File:common_shadow.jpg|64px]]
|}</text>
    </revision>
  </page>
  <page>
    <title>Console</title>
    <ns>0</ns>
    <id>270</id>
    <redirect title="Cvar" />
      <sha1>p1mawz7g5r6tpht152mg8ns0x37ja12</sha1>
    <revision>
      <id>2642</id>
      <timestamp>2012-08-30T17:40:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Redirected page to [[Cvar]]</comment>
      <text xml:space="preserve" bytes="18">#REDIRECT [[Cvar]]</text>
    </revision>
  </page>
  <page>
    <title>Custinfoparms.txt</title>
    <ns>0</ns>
    <id>128</id>
      <sha1>tlmti5u8omuvk9swyr53tcyqkax964l</sha1>
    <revision>
      <id>1429</id>
      <timestamp>2012-07-22T19:59:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;A script file that defines a custom surfaceparms to be used with '''surfaceparm''' keyword in materials.  This file should be created in Gamedir/basepath/scripts  Syntax of cu...&quot;</comment>
      <text xml:space="preserve" bytes="707">A script file that defines a custom surfaceparms to be used with '''surfaceparm''' keyword in materials.

This file should be created in Gamedir/basepath/scripts

Syntax of custinfoparms.txt:

 &lt;font color=green&gt;// Contentflags&lt;/font&gt;
 {
     surfaceparmname contentflag_HEX_integer
     surfaceparmname2 contentflag_HEX_integer
     ...
 }
 &lt;font color=green&gt;// Surfaceflags&lt;/font&gt;
 {
     surfaceparmname surfaceflag_HEX_integer
     surfaceparmname2 contentflag_HEX_integer
     ...
 }

HEX integer are in 0x00000000 format.

=== Limits ===
* Stock Q3map2 allows max 64 custom surfaceparms
* Blood Omnicide Q3map2 allows max 1024 custom surfaceparms
* Darkplaces engine allows max 256 custom surfaceparms</text>
    </revision>
    <revision>
      <id>1430</id>
      <timestamp>2012-07-22T19:59:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="756">A script file that defines a custom surfaceparms to be used with '''surfaceparm''' keyword in materials.

This file should be created in Gamedir/basepath/scripts

Syntax of custinfoparms.txt:

 &lt;font color=green&gt;// Contentflags&lt;/font&gt;
 {
     surfaceparmname contentflag_HEX_integer
     surfaceparmname2 contentflag_HEX_integer
     ...
 }
 &lt;font color=green&gt;// Surfaceflags&lt;/font&gt;
 {
     surfaceparmname surfaceflag_HEX_integer
     surfaceparmname2 contentflag_HEX_integer
     ...
 }

HEX integer are in 0x00000000 format.

=== Limits ===
* Stock Q3map2 allows max 64 custom surfaceparms
* Blood Omnicide Q3map2 allows max 1024 custom surfaceparms
* Darkplaces engine allows max 256 custom surfaceparms

== See also ==
* [[Darkplaces material system]]</text>
    </revision>
    <revision>
      <id>1431</id>
      <timestamp>2012-07-22T20:01:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="855">A script file that defines a custom surfaceparms to be used with '''surfaceparm''' keyword in materials.

This file should be created in Gamedir/basepath/scripts

Syntax of custinfoparms.txt:

 &lt;font color=green&gt;// Contentflags&lt;/font&gt;
 {
     surfaceparmname integer
     surfaceparmname2 integer
     ...
     surfaceparmnameX integer
 }
 &lt;font color=green&gt;// Surfaceflags&lt;/font&gt;
 {
     surfaceparmname integer
     surfaceparmname2 integer
     ...
     surfaceparmnameX integer
 }

Integer are HEX values in 0x00000000 format representing surfaceflags and contentflags to be assigned with corresponding custom surfaceparm.

=== Limits ===
* Stock Q3map2 allows max 64 custom surfaceparms
* Blood Omnicide Q3map2 allows max 1024 custom surfaceparms
* Darkplaces engine allows max 256 custom surfaceparms

== See also ==
* [[Darkplaces material system]]</text>
    </revision>
    <revision>
      <id>1892</id>
      <timestamp>2012-07-27T06:48:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="887">A script file that defines a custom surfaceparms to be used with '''surfaceparm''' keyword in materials.

This file should be created in Gamedir/basepath/scripts

Syntax of custinfoparms.txt:

 &lt;font color=green&gt;// Contentflags&lt;/font&gt;
 {
     surfaceparmname integer
     surfaceparmname2 integer
     ...
     surfaceparmnameX integer
 }
 &lt;font color=green&gt;// Surfaceflags&lt;/font&gt;
 {
     surfaceparmname integer
     surfaceparmname2 integer
     ...
     surfaceparmnameX integer
 }

Integer are HEX values in 0x00000000 format representing surfaceflags and contentflags to be assigned with corresponding custom surfaceparm.

=== Limits ===
* Stock Q3map2 allows max 64 custom surfaceparms
* Blood Omnicide Q3map2 allows max 1024 custom surfaceparms
* Darkplaces engine allows max 256 custom surfaceparms

== See also ==
* [[Darkplaces material system]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2278</id>
      <timestamp>2012-07-30T20:42:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="900">A script file that defines a custom surfaceparms to be used with '''surfaceparm''' keyword in materials.

This file should be created in Gamedir/basepath/scripts

Syntax of custinfoparms.txt:

 &lt;font color=green&gt;// Contentflags&lt;/font&gt;
 {
     surfaceparmname integer
     surfaceparmname2 integer
     ...
     surfaceparmnameX integer
 }
 &lt;font color=green&gt;// Surfaceflags&lt;/font&gt;
 {
     surfaceparmname integer
     surfaceparmname2 integer
     ...
     surfaceparmnameX integer
 }

Integer are HEX values in 0x00000000 format representing surfaceflags and contentflags to be assigned with corresponding custom surfaceparm.

=== Limits ===
* Stock Q3map2 allows max 64 custom surfaceparms
* Blood Omnicide Q3map2 allows max 1024 custom surfaceparms
* Darkplaces engine allows max 256 custom surfaceparms

== See also ==
* [[Darkplaces material system]]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Cvar</title>
    <ns>0</ns>
    <id>11</id>
      <sha1>o43iop92yamm21slhb0cv734xsfckea</sha1>
    <revision>
      <id>98</id>
      <timestamp>2012-07-02T18:32:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;[[Category: Quake Terminology]]&quot;</comment>
      <text xml:space="preserve" bytes="31">[[Category: Quake Terminology]]</text>
    </revision>
    <revision>
      <id>99</id>
      <timestamp>2012-07-02T18:35:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="344">CVar are abbreviation of Console Variable.

This is variable used in many computer games that can be manipulated by a text based command line interface within the game or engine, called a console.

In Blood Omnicide, cvars are manipulated by console and QuakeC. Console is bringed down by pressing SHIFT+ESCAPE.

[[Category: Quake Terminology]]</text>
    </revision>
    <revision>
      <id>100</id>
      <timestamp>2012-07-02T18:35:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="344">Cvar are abbreviation of Console Variable.

This is variable used in many computer games that can be manipulated by a text based command line interface within the game or engine, called a console.

In Blood Omnicide, cvars are manipulated by console and QuakeC. Console is bringed down by pressing SHIFT+ESCAPE.

[[Category: Quake Terminology]]</text>
    </revision>
    <revision>
      <id>101</id>
      <timestamp>2012-07-02T18:37:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="354">Cvar are abbreviation of Console Variable.

This is variable used in many computer games that can be manipulated by a text based command line interface within the game or engine, called a console.

In Blood Omnicide, cvars are manipulated by console and QuakeC. Console is bringed down by pressing SHIFT+ESCAPE.

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>430</id>
      <timestamp>2012-07-14T19:47:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="334">Cvar are abbreviation of Console Variable.

This is variable used in many computer games that can be manipulated by a text based command line interface within the game or engine, called a console.

In Blood Omnicide, cvars are manipulated by console and QuakeC. Console is bringed down by pressing SHIFT+ESCAPE.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3590</id>
      <timestamp>2013-02-14T15:59:17Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="334">Cvar is the abbreviation of Console Variable.

This variable is used in many computer games that can be manipulated by a text based command line interface within the game or engine, called a console.

In Blood Omnicide, cvars are manipulated by console and QuakeC. You can open console by pressing SHIFT+ESCAPE.

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>DDS</title>
    <ns>0</ns>
    <id>178</id>
      <sha1>jrk3nq4exufsflfh9l6lvoc4fn1x896</sha1>
    <revision>
      <id>2164</id>
      <timestamp>2012-07-29T20:30:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Direct Draw Suface is a file format developed by Microsoft for DirectX SDK.  Eventually, this format become general in many games to store [[texture compression | compressed t...&quot;</comment>
      <text xml:space="preserve" bytes="3371">Direct Draw Suface is a file format developed by Microsoft for DirectX SDK.

Eventually, this format become general in many games to store [[texture compression | compressed textures]].

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicPip material keyword]], also gfx/ images never use mipmaps) or it can crash.}}

{{important|DDS files should be a power-of-two textures, thats because some drivers don't deal with non-power-of-two compressed textures (which will result in black walls).}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2175</id>
      <timestamp>2012-07-29T20:57:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3724">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. Eventually, this format become general in many games to store [[texture compression | compressed textures]].

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicPip material keyword]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (can result in black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2186</id>
      <timestamp>2012-07-29T21:06:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3949">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicPip material keyword]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (can result in black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2188</id>
      <timestamp>2012-07-29T21:59:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3935">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicPip material keyword]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2189</id>
      <timestamp>2012-07-29T22:41:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3918">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2190</id>
      <timestamp>2012-07-29T22:41:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3929">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2267</id>
      <timestamp>2012-07-30T20:36:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3944">{{unfinished}}
{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps on this texture (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2360</id>
      <timestamp>2012-08-01T11:27:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3957">{{unfinished}}
{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps if they are not exist in DDS (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2361</id>
      <timestamp>2012-08-01T11:29:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3955">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there is no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps if they are not exist in DDS (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it can crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2381</id>
      <timestamp>2012-08-02T14:32:42Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3955">{{grammar}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing the images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS are not general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if presented. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there are no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps if they do not exist in DDS (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it may crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2707</id>
      <timestamp>2012-09-28T13:34:05Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="3964">{{grammar checked|darth}}
Direct Draw Suface is a file format developed by Microsoft for DirectX SDK. This format is used in many games to store [[texture compression | compressed textures]]. 

Darkplaces engine can load DDS storing images of the following formats:
* '''BGRA''' : 32-bit uncompressed image
* '''DXT1''' : 4-bit compressed DXT1 texture
* '''DXT2''' : 8-bit compressed DXT2 texture
* '''DXT3''' : 8-bit compressed DXT3 texture
* '''DXT4''' : 8-bit compressed DXT4 texture
* '''DXT5''' : 8-bit compressed DXT5 texture

In Darkplaces, DDS is not a general texture format like [[TGA]] or [[JPEG]] but an override texture (dds/filename.dds) that get loaded instead of it's base texture (filename.tga), if present. 

All DDS files should be stored under dds/ directory, rest of the path should mimic file path of the base texture:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// override textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// override models/mapobjects/inn/barrel1_1&lt;/font&gt;

DDS files should have mipmaps pre-generated. If there are no mipmaps generated, it is implied that this texture is not using mipmaps. 

{{important|Engine shouldn't try to use mipmaps if they do not exist in DDS (see [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], also gfx/ images never use mipmaps) or it may crash.}}

{{bug|Some drivers don't deal with non-power-of-two compressed textures (giving the black walls). Best way is to always make DDS textures to be [[power-of-two]].}}

===DDS for NetRadiant===

Unfortunately, NetRadiant can't load DDS images, it always loads base texture instead. This becomes a problem when supplying Radiant with the builded game (which only include DDS, no base textures). In order to avoid missing textures and broken brush texturing, every world texture that gotta be applied on [[brush | brushes]], should have separate radiant-only image (see [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

By a convention, radiant-only image should be stored in ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tools==
You can use following tools to produce compressed DDS images:
* [[RwgTex]] - recommended commandline tool used by Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (requires registration)

==Future alternatives==
In 2010 Khronos group introduced [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] format (covering OpenGL and OpenGL ES texture formats). This format can be used as a replacement to DDS in future.

==Console variables==
{{cvar|r_texture_dds_load|load compressed dds/filename.dds instead of filename.tga. If file exists (requires driver support).}}
{{cvar|r_texture_dds_load_alphamode|trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only}}
{{cvar|r_texture_dds_load_logfailure|log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all}}
{{cvar|r_texture_dds_save|save compressed dds/filename.dds texture when filename.tga is loaded, so that it can be loaded instead next time}}
{{cvar|r_texture_dds_swdecode|0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS. Software decoding breaks all benefits of DDS and should be used if driver dont support DDS or for debugging purposes.}}

==See also==
* [[texture compression | Texture compression]]

[[Category:Glossary]]
[[Category:File formats]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>DPSUBS</title>
    <ns>0</ns>
    <id>15</id>
      <sha1>6hy3hykmujnoyhrc1dbgpht03g7xn4s</sha1>
    <revision>
      <id>110</id>
      <timestamp>2012-07-02T18:49:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;.DPSUBS is a plain text files used to add subtitles to Darkplaces Cinematics player.  While subtitles draw properties re set by [[cvar | cvars]]  [[Category:File formats]]&quot;</comment>
      <text xml:space="preserve" bytes="171">.DPSUBS is a plain text files used to add subtitles to Darkplaces Cinematics player.

While subtitles draw properties re set by [[cvar | cvars]]

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>118</id>
      <timestamp>2012-07-02T18:56:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="649">.DPSUBS is a plain text files used to add subtitles to Darkplaces Cinematics player.

While subtitles renderer properties is set by [[cvar | cvars]], subtitle texts are stored in .dpsubs file.

Each line of dpsubs containsthree tokens separated by space or tab.

* 1: subtitle start time
* 2: subtitle length (can be negative, in this case subtitle will be shown until next subtitle starts).
* 3: subtitle text

Example of file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Call your dogs! They can feast on your corpses!&quot;

.DPSUBS should be encoded with UTF-8 with no BOM (Byte-Order-Mark).

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>119</id>
      <timestamp>2012-07-02T18:56:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="641">.DPSUBS is a plain text files used to add subtitles to Darkplaces Cinematics player.

While subtitles renderer properties is set by [[cvar | cvars]], subtitle texts are stored in .dpsubs file.

Each line of dpsubs contains three tokens separated by space or tab.

# subtitle start time
# subtitle length (can be negative, in this case subtitle will be shown until next subtitle starts).
# subtitle text

Example of file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Call your dogs! They can feast on your corpses!&quot;

.DPSUBS should be encoded with UTF-8 with no BOM (Byte-Order-Mark).

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>993</id>
      <timestamp>2012-07-17T05:17:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="622">Text files used to add subtitles to Darkplaces Cinematics player.

While subtitles renderer properties is set by [[cvar | cvars]], subtitle texts are stored in .dpsubs file.

Each line of dpsubs contains three tokens separated by space or tab.

# subtitle start time
# subtitle length (can be negative, in this case subtitle will be shown until next subtitle starts).
# subtitle text

Example of file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Call your dogs! They can feast on your corpses!&quot;

.DPSUBS should be encoded with UTF-8 with no BOM (Byte-Order-Mark).

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1045</id>
      <timestamp>2012-07-17T20:30:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="621">Text file used to add subtitles to Darkplaces Cinematics player.

While subtitles renderer properties is set by [[cvar | cvars]], subtitle texts are stored in .dpsubs file.

Each line of dpsubs contains three tokens separated by space or tab.

# subtitle start time
# subtitle length (can be negative, in this case subtitle will be shown until next subtitle starts).
# subtitle text

Example of file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Call your dogs! They can feast on your corpses!&quot;

.DPSUBS should be encoded with UTF-8 with no BOM (Byte-Order-Mark).

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1047</id>
      <timestamp>2012-07-17T20:31:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="626">Text file used to add subtitles to Darkplaces Cinematics player.

While subtitles renderer properties is set by [[cvar | cvars]], subtitle texts are stored in .dpsubs file.

Each line of dpsubs contains three tokens separated by space or tab.

# subtitle start time
# subtitle length (can be negative, in this case subtitle will be shown until next subtitle starts).
# subtitle text

Example of file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Call your dogs! They can feast on your corpses!&quot;

Dpsubs files should be encoded with UTF-8 with no BOM (Byte-Order-Mark).

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1330</id>
      <timestamp>2012-07-20T11:01:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="657">Text file used to add subtitles to Darkplaces Cinematics player.

While subtitles renderer properties is set by [[cvar | cvars]], subtitle texts are stored in .dpsubs file.

Each line of dpsubs contains three tokens separated by space or tab.

# subtitle start time
# subtitle length (can be negative, in this case subtitle will be shown until next subtitle starts).
# subtitle text

Example of file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Call your dogs! They can feast on your corpses!&quot;

Dpsubs files should be encoded with UTF-8 with no BOM (Byte-Order-Mark).

[[Category:File formats]]
[[Category:Darkplaces engine]]</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces MD3 Exporter</title>
    <ns>0</ns>
    <id>279</id>
      <sha1>6y7g3to1mnjcbrmiib97p7ilpu308hj</sha1>
    <revision>
      <id>2803</id>
      <timestamp>2012-11-21T19:53:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]] [[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]] Darkplaces MD3 Exporter -...&quot;</comment>
      <text xml:space="preserve" bytes="2937">[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features===
* Export Quake 3 .MD3 models
* Export animations (frame range)
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added in version 1.0===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals were exported wrong in Pop'N'Fresh)
* Support for smoothing groups and '''edit normals''' modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot position (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are null)
* Test shader script output
* Frame range now defaults to 0
* Can export primitives

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]</text>
    </revision>
    <revision>
      <id>2804</id>
      <timestamp>2012-11-21T20:02:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3230">[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added in version 1.0===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals were exported wrong in Pop'N'Fresh)
* Support for smoothing groups and '''edit normals''' modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0
* Can export primitives

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2807</id>
      <timestamp>2012-11-21T20:23:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3255">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added in version 1.0===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals were exported wrong in Pop'N'Fresh)
* Support for smoothing groups and '''edit normals''' modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0
* Can export primitives

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2808</id>
      <timestamp>2012-11-21T20:23:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3240">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals were exported wrong in Pop'N'Fresh)
* Support for smoothing groups and '''edit normals''' modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0
* Can export primitives

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2809</id>
      <timestamp>2012-11-21T20:24:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3233">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and '''edit normals''' modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0
* Can export primitives

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2810</id>
      <timestamp>2012-11-21T20:24:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3227">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and edit normals modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0
* Can export primitives

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3664</id>
      <timestamp>2013-09-19T21:05:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Features added */</comment>
      <text xml:space="preserve" bytes="3203">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and edit normals modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0

==Downloads==
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_src.zip Darkplaces MD3 Exporter 1.0 sourcecode]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3665</id>
      <timestamp>2013-09-19T21:57:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Downloads */</comment>
      <text xml:space="preserve" bytes="3448">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and edit normals modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0

==Downloads==
* [https://github.com/paulvortex/MaxDpMd3Exporter Darkplaces MD3 Exporter GitHub repository]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x64]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3666</id>
      <timestamp>2013-09-19T21:59:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Downloads */</comment>
      <text xml:space="preserve" bytes="3470">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and edit normals modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0

==Downloads==
* [https://github.com/paulvortex/MaxDpMd3Exporter Darkplaces MD3 Exporter GitHub repository]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x86 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x64 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3667</id>
      <timestamp>2013-09-19T22:09:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Downloads */</comment>
      <text xml:space="preserve" bytes="3446">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and edit normals modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes doesnt have valid data structures for mirrored objects, and this cant be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0

==Downloads==
* [https://github.com/paulvortex/MaxDpMd3Exporter GitHub repository]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x86 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x64 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3669</id>
      <timestamp>2013-09-21T06:27:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Features added */</comment>
      <text xml:space="preserve" bytes="3450">{{finished}}
{{grammar}}
[[File:Darkplacesmd3exporter.png|thumb|400px|right|exporter main window]]
[[File:Darkplacesmd3exporter2.png|thumb|400px|right|export results window]]
Darkplaces MD3 Exporter - a plugin for 3D Studio Max to export [[MD3]] models developed by Pavel [VorteX] Timofeyev.

Plugin code is based on Pop'N'Fresh's MD3 exporter for MAX3.

Goals are:

* Clean up and improve for use with recent versions of 3DS MAX
* Provide reliable tool that gives warning for each thing that is wrong and needs to be fixed for correct exporting
* Export good MD3's with correct normals and material names with no need of post-fixing
* Remove some old Quake 3-related switches (such as torso/legs exporting, object names filtering) not used with Darkplaces engine

===General features (provided by Pop'N'Fresh plugin)===
* Export Quake 3 [[MD3]] models
* Export animations (frame ranges, can set several ranges separated by ''',''')
* Export tags (objects which names starts with ''tag_'')
* Export current materials as shadernames (detect root by searching for textures/ in bitmap path)

===Features added===
* Fixed normals exporting to entirely match MD3 specs (some cases with pure vertical normals wasnt exported right before)
* Support for smoothing groups and edit normals modifier
* Better exporting of mirrored objects (ones having negative scale), warning are given anyway as max sometimes does not have valid data structures for mirrored objects, and this cannot be autofixed during exporting
* Can export primitives
* Can get material name from multimaterial's first layer (some importers, like COLLADA, always sets multimaterial)
* New &quot;create tag_pivot for pivot position&quot; option to create tag for object's pivot (useful for defining center of mass or light sampling point)
* New &quot;export chunks&quot; option to export separate .md3 model for each selected object
* Option to detect &quot;collision&quot; and &quot;shadow&quot; meshes, this meshes always exported 'as is' with no additional seams added (UV are null, vertex normals are null)
* Export results window with prints about missing normals, bogus mesh names, null materials etc.
* Advanced paths exporting (autoconverting \ to /, support path in material name, detects &quot;textures/&quot;, &quot;models/&quot;, &quot;gfx/&quot; as path root)
* Fixed UV exporting to use vertex channels instead of legacy getVert/getNumTVerts (sometimes this legacy structures are empty)
* Test shader script output
* Frame range defaults to 0

==Downloads==
* [https://github.com/paulvortex/MaxDpMd3Exporter GitHub repository]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max7.zip Darkplaces MD3 Exporter 1.0 for Max 7]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x86 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2011_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2011 x64 (untested)]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x86.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x86]
* [http://omnicide.legacy-of-kain.ru/files/tools/darkplacesmd3exporter_1.00_max2012_x64.zip Darkplaces MD3 Exporter 1.0 for Max 2012 x64]

==See also==
* [[MD3 Compiler|NPherno's MD3 Compiler]]
* [[3dsMax MD3 Importer|Chris Cookson's 3ds Max MD3 Importer ]]
* [[3dsMax ASE Importer|3ds Max ASE Import plugin]]

[[Category:Tools]]
[[Category:3ds Max]]
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces effectinfo reference</title>
    <ns>0</ns>
    <id>124</id>
      <sha1>55y8ydbqsld26vvr0trs8nvkqi04gof</sha1>
    <revision>
      <id>1326</id>
      <timestamp>2012-07-20T10:58:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.  Each effect can have several ...&quot;</comment>
      <text xml:space="preserve" bytes="8804">EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

== General syntax ==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

== Console variables ==

r_drawparticles : toggle drawing of all particles

r_drawparticles_drawdistance : set a maximal distance to draw particles at

cl_particles_size : this will scale a size of all particles

cl_particles_quality : multiplier of particles count spawned by emitters, better quality = more particles (1 - min, 4 - max. quality)

cl_particles_reloadeffects : reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects

== Particle parameters ==

''' effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

''' count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

''' countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

''' type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

: alphastatic : alpha-blended billboard
: static : additive-blended billboard
: spark : additive blended, stretched (based on velocity)
: beam : a beam particle, drawn from origin to origin + velocity
: rain : a rain particle, alpha-blended spart that will cause splash effect on impact
: raindecal: oriented rain decal, additive-blended
: snow: alpha blended, velocity jitters in realtime
: bubble: alpha-blended
: blood: inverse-modulated, leaves decal
: smoke: alpha-blended billboard
: decal: makes a decal on nearest surface
: entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

''' blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

''' orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

: billboard : always turned to viewer

: oriented : ignores viewwer, turned to velocity

: beam : facing viewer on 2 axises, stretched from origin to origin + velocity

: spark : facing viewer on 2 axises, stretched (based on velocity)

''' color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

''' tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

''' size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

''' sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

''' alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

''' time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

''' gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

''' bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

''' airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

''' liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

''' originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

''' velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

''' originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

''' velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

''' velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

''' underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

''' notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

''' trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

''' stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

''' rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

== Particles leaving decals ==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

''' staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

''' stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

''' stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

''' staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

''' stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

== Dynamic lights ==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

== Engine effect names ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE</text>
    </revision>
    <revision>
      <id>1327</id>
      <timestamp>2012-07-20T10:58:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8836">EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

== General syntax ==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

== Console variables ==

r_drawparticles : toggle drawing of all particles

r_drawparticles_drawdistance : set a maximal distance to draw particles at

cl_particles_size : this will scale a size of all particles

cl_particles_quality : multiplier of particles count spawned by emitters, better quality = more particles (1 - min, 4 - max. quality)

cl_particles_reloadeffects : reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects

== Particle parameters ==

''' effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

''' count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

''' countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

''' type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

: alphastatic : alpha-blended billboard
: static : additive-blended billboard
: spark : additive blended, stretched (based on velocity)
: beam : a beam particle, drawn from origin to origin + velocity
: rain : a rain particle, alpha-blended spart that will cause splash effect on impact
: raindecal: oriented rain decal, additive-blended
: snow: alpha blended, velocity jitters in realtime
: bubble: alpha-blended
: blood: inverse-modulated, leaves decal
: smoke: alpha-blended billboard
: decal: makes a decal on nearest surface
: entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

''' blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

''' orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

: billboard : always turned to viewer

: oriented : ignores viewwer, turned to velocity

: beam : facing viewer on 2 axises, stretched from origin to origin + velocity

: spark : facing viewer on 2 axises, stretched (based on velocity)

''' color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

''' tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

''' size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

''' sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

''' alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

''' time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

''' gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

''' bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

''' airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

''' liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

''' originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

''' velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

''' originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

''' velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

''' velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

''' underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

''' notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

''' trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

''' stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

''' rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

== Particles leaving decals ==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

''' staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

''' stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

''' stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

''' staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

''' stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

== Dynamic lights ==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

== Engine effect names ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2292</id>
      <timestamp>2012-07-30T21:46:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8849">EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

== General syntax ==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

== Console variables ==

r_drawparticles : toggle drawing of all particles

r_drawparticles_drawdistance : set a maximal distance to draw particles at

cl_particles_size : this will scale a size of all particles

cl_particles_quality : multiplier of particles count spawned by emitters, better quality = more particles (1 - min, 4 - max. quality)

cl_particles_reloadeffects : reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects

== Particle parameters ==

''' effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

''' count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

''' countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

''' type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

: alphastatic : alpha-blended billboard
: static : additive-blended billboard
: spark : additive blended, stretched (based on velocity)
: beam : a beam particle, drawn from origin to origin + velocity
: rain : a rain particle, alpha-blended spart that will cause splash effect on impact
: raindecal: oriented rain decal, additive-blended
: snow: alpha blended, velocity jitters in realtime
: bubble: alpha-blended
: blood: inverse-modulated, leaves decal
: smoke: alpha-blended billboard
: decal: makes a decal on nearest surface
: entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

''' blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

''' orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

: billboard : always turned to viewer

: oriented : ignores viewwer, turned to velocity

: beam : facing viewer on 2 axises, stretched from origin to origin + velocity

: spark : facing viewer on 2 axises, stretched (based on velocity)

''' color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

''' tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

''' size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

''' sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

''' alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

''' time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

''' gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

''' bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

''' airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

''' liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

''' originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

''' velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

''' originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

''' velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

''' velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

''' underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

''' notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

''' trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

''' stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

''' rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

== Particles leaving decals ==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

''' staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

''' stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

''' stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

''' staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

''' stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

== Dynamic lights ==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

== Engine effect names ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2451</id>
      <timestamp>2012-08-03T13:38:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8820">EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

==General syntax==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

==Particle parameters==

'''effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

'''count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

'''countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

'''type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

:alphastatic : alpha-blended billboard
:static : additive-blended billboard
:spark : additive blended, stretched (based on velocity)
:beam : a beam particle, drawn from origin to origin + velocity
:rain : a rain particle, alpha-blended spart that will cause splash effect on impact
:raindecal: oriented rain decal, additive-blended
:snow: alpha blended, velocity jitters in realtime
:bubble: alpha-blended
:blood: inverse-modulated, leaves decal
:smoke: alpha-blended billboard
:decal: makes a decal on nearest surface
:entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

'''blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

'''orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

:billboard : always turned to viewer

:oriented : ignores viewwer, turned to velocity

:beam : facing viewer on 2 axises, stretched from origin to origin + velocity

:spark : facing viewer on 2 axises, stretched (based on velocity)

'''color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

'''tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

'''size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

'''sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

'''alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

'''time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

'''gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

'''bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

'''airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

'''liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

'''originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

'''velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

'''originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

'''velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

'''velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

'''underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

'''notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

'''trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

'''stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

'''rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

==Particles leaving decals==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

'''staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

'''stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

'''stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

'''staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

'''stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

==Dynamic lights==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

==Engine effect name ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE

==Console variables==
{{cvar|r_drawparticles|toggle drawing of all particles}}
{{cvar|r_drawparticles_drawdistance|set a maximal distance to draw particles at}}
{{cvar|cl_particles_size|this will scale a size of all particles}}
{{cvar|cl_particles_quality|multiplier of particles count spawned by emitters, better quality = more particles (1 - min, 4 - max. quality)}}
{{cvar|cl_particles_reloadeffects|reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects}}

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2452</id>
      <timestamp>2012-08-03T13:39:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console variables */</comment>
      <text xml:space="preserve" bytes="8837">EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

==General syntax==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

==Particle parameters==

'''effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

'''count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

'''countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

'''type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

:alphastatic : alpha-blended billboard
:static : additive-blended billboard
:spark : additive blended, stretched (based on velocity)
:beam : a beam particle, drawn from origin to origin + velocity
:rain : a rain particle, alpha-blended spart that will cause splash effect on impact
:raindecal: oriented rain decal, additive-blended
:snow: alpha blended, velocity jitters in realtime
:bubble: alpha-blended
:blood: inverse-modulated, leaves decal
:smoke: alpha-blended billboard
:decal: makes a decal on nearest surface
:entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

'''blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

'''orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

:billboard : always turned to viewer

:oriented : ignores viewwer, turned to velocity

:beam : facing viewer on 2 axises, stretched from origin to origin + velocity

:spark : facing viewer on 2 axises, stretched (based on velocity)

'''color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

'''tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

'''size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

'''sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

'''alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

'''time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

'''gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

'''bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

'''airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

'''liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

'''originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

'''velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

'''originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

'''velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

'''velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

'''underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

'''notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

'''trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

'''stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

'''rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

==Particles leaving decals==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

'''staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

'''stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

'''stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

'''staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

'''stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

==Dynamic lights==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

==Engine effect name ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE

==Console variables==
{{cvar|r_drawparticles|toggle drawing of all particles}}
{{cvar|r_drawparticles_drawdistance|set a maximal distance to draw particles at}}
{{cvar|cl_particles_size|this will scale a size of all particles}}
{{cvar|cl_particles_quality|multiplier of particles count spawned by emitters, better quality = more particles &lt;nowiki&gt;(1 - min, 4 - max. quality)&lt;/nowiki&gt;}}
{{cvar|cl_particles_reloadeffects|reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects}}

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2453</id>
      <timestamp>2012-08-03T13:39:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console variables */</comment>
      <text xml:space="preserve" bytes="8837">EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

==General syntax==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

==Particle parameters==

'''effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

'''count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

'''countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

'''type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

:alphastatic : alpha-blended billboard
:static : additive-blended billboard
:spark : additive blended, stretched (based on velocity)
:beam : a beam particle, drawn from origin to origin + velocity
:rain : a rain particle, alpha-blended spart that will cause splash effect on impact
:raindecal: oriented rain decal, additive-blended
:snow: alpha blended, velocity jitters in realtime
:bubble: alpha-blended
:blood: inverse-modulated, leaves decal
:smoke: alpha-blended billboard
:decal: makes a decal on nearest surface
:entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

'''blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

'''orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

:billboard : always turned to viewer

:oriented : ignores viewwer, turned to velocity

:beam : facing viewer on 2 axises, stretched from origin to origin + velocity

:spark : facing viewer on 2 axises, stretched (based on velocity)

'''color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

'''tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

'''size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

'''sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

'''alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

'''time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

'''gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

'''bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

'''airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

'''liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

'''originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

'''velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

'''originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

'''velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

'''velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

'''underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

'''notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

'''trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

'''stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

'''rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

==Particles leaving decals==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

'''staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

'''stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

'''stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

'''staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

'''stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

==Dynamic lights==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

==Engine effect name ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE

==Console variables==
{{cvar|r_drawparticles|toggle drawing of all particles}}
{{cvar|r_drawparticles_drawdistance|set a maximal distance to draw particles at}}
{{cvar|cl_particles_size|this will scale a size of all particles}}
{{cvar|cl_particles_quality|multiplier of particles count spawned by emitters, better quality &lt;nowiki&gt;= more particles (1 - min, 4 - max. quality)&lt;/nowiki&gt;}}
{{cvar|cl_particles_reloadeffects|reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects}}

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2901</id>
      <timestamp>2012-11-23T01:18:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="8850">{{TOCRIGHT}}
EffectInfo is built-in scripting language to describe particle effects in DarkPlaces, it's pretty simple and contains basic scripting functions.

Each effect can have several emitters which is defined in effectinfo.txt or maps/''mapname''_effectinfo.txt. Where mapname is a name of the map currently loaded (without path and extension).

==General syntax==

  // emitter 1
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter 2
  effect EFFECT_NAME
  parm value
  parm2 value
  ...
  
  // emitter for another effect
  effect ANOTHER_EFFECT
  parm value
  parm2 value
  ...

==Particle parameters==

'''effect &lt;name&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a new emitter with effectname is belongs to, all parms after that will be applied to that emitter.

'''count &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;How many particles to spawn at this emitter, this setting is affected by cl_particles_quality cvar

'''countabsolute &lt;count&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Defines a count of particles spawned regardless of cl_particles_quality setting

&amp;nbsp;&amp;nbsp;&amp;nbsp;Total particles count = countabsolute + count * cl_particles_quality 

'''type &lt;type&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a generic particle type, affect appearance, blending, physics.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of particle types:

:alphastatic : alpha-blended billboard
:static : additive-blended billboard
:spark : additive blended, stretched (based on velocity)
:beam : a beam particle, drawn from origin to origin + velocity
:rain : a rain particle, alpha-blended spart that will cause splash effect on impact
:raindecal: oriented rain decal, additive-blended
:snow: alpha blended, velocity jitters in realtime
:bubble: alpha-blended
:blood: inverse-modulated, leaves decal
:smoke: alpha-blended billboard
:decal: makes a decal on nearest surface
:entityparticle: alpha-blended, this particle gets removed after being drawn (used on EF_BRIGHTFIELD)

'''blend &lt;blendtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Generic blend is set by type, but with this parm it cound be changed after type is defined.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of blend types:

: alpha : alpha blended
: add: additive blended
: invmod: inverse modulation (used on blood and blood decals)

'''orientation &lt;orientationtype&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as for blend, generic orientation is set by type, could be altered by this parm.

&amp;nbsp;&amp;nbsp;&amp;nbsp;List of orientation types:

:billboard : always turned to viewer

:oriented : ignores viewwer, turned to velocity

:beam : facing viewer on 2 axises, stretched from origin to origin + velocity

:spark : facing viewer on 2 axises, stretched (based on velocity)

'''color &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a color for particles. On each particle spawn, it's color is linearly randomized betwen two given colors. Color should be defined as HEX 0xRRGGBB, like 0xFFFFFF is white, and 0xFF0000 is red.

'''tex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a index of particle from particlefont. Indexes are counted from left to right, from up to down, last index is 63, first is 0. Randomized linearly on each particle spawn.

'''size &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Size of particle in game units, typical value is 4, randomized.

'''sizeincrease &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This will make particle grow or diminish over time. &lt;rate&gt; is to how much utits to add or subtract per second. Note that while diminishing particle, engine will not check if particle will go to negative size, it will just invert it.

'''alpha &lt;min_alpha&gt; &lt;max_alpha&gt; &lt;fade_rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Opacity of particles, 256 is opaque, 0 is transparent. Randomized. Could be more that 256 (to simulate fade delay). Fade rate is how huch alpha to throw away per second, once particle gets alpha 0 (full transparence), it gets removed.

'''time &lt;min_time&gt; &lt;max_time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle time-to-live in seconds, randomized.

'''gravity &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle gravity modifier, 1 is full gravity, 0.5 is half etc., negative values are supported (particle go up).

'''bounce &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle bounce-of-walls factor, 1 - bounce with full speed, 0.5 bounce with half speed. A value of -1 means particle will be removed on impact. Not that particle physics considered slow and spawning lots of bouncing particles is not recommended.

'''airfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in air, good option for smoke emitters. A value of 0 means no friction, negative values will do acceleration. 

'''liquidfriction &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Particle friction while moving in liquids.

'''originoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Offset particle spawning origin by this values. Coordspace are world, x - forward, y - right, z - up.

'''velocityoffset &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Add this amount of constant velocity to particle on spawn.

'''originjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Like originoffset but each axis is jittered between -value/+value. Hence it is defining spherical shape of particle random spawning.

'''velocityjitter &lt;x&gt; &lt;y&gt; &lt;z&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Same as originjitter but for velocity.

'''velocitymultiplier &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Multiply particle starting velocity (one that set by QC or engine, whatever calls effect) by this value. Useful with trails. Negative values are supported.

'''underwater  '''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets underwater flag for particles. Particles that are underwater will be removed in air. Useful for water bubbles.

'''notunderwater'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets notunderwater flag for particles. Particles that are notunderwater will be removed in liquid. Useful for fire particles.

'''trailspacing &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;This parm is only useful when effect is spawned as trail, defines a game units gap between effect invocations.

'''stretchfactor &lt;x&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A custom stretch factor that is used on sparks. 

'''rotate &lt;startangle_min&gt; &lt;startangle_max&gt; &lt;spin_min&gt; &lt;spin_max&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Used to rotate particle, first 2 parms is start angle, other two are spin velocity.

==Particles leaving decals==
Particles can leave decals once hit something. For this behavior a special set of parms should be used. This section is unfinished, futher explanation is required.

'''staincolor &lt;min_color&gt; &lt;max_color&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized color for decal particle.

'''stainalpha &lt;min_alpha&gt; &lt;max_alpha&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized alpha.

'''stainsize &lt;min_size&gt; &lt;max_size&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized size.

'''staintex &lt;min_index&gt; &lt;max_index&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A randomized index into particlefont.

'''stainless'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Disables decal spawning and returns all parms to it's default values.

==Dynamic lights==
Dynamic realtime lights could be placed in particle effects (useful for explosions) with this range of parms. This parms applied just like standart ones.

'''lightradius &lt;radius&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius of light in game units. Typical value is 200.

'''lightradiusfade &lt;rate&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Radius fade rate, how many units to add/subtract per second. Once light reaches radius of 0 it gets removed.

'''lighttime &lt;time&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;If radius fading not set, this parm can be used to define light life time.

'''lightcolor &lt;red&gt; &lt;green&gt; &lt;blue&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;A RGB-normalized light color, 1 1 1 is white, 0 0 1 is blue. Can exceed 1 (overbright light).

'''lightshadow &lt;value&gt;'''

&amp;nbsp;&amp;nbsp;&amp;nbsp;Cast shadows from light, value is 0 or 1.

'''lightcubemapnum &lt;value&gt;'''
	
&amp;nbsp;&amp;nbsp;&amp;nbsp;Sets a numbered cubefilter for light, cubemap texture is cubemaps/&lt;value&gt;

==Engine effect name ==
Heres a list of effect names used by engine.

: TE_GUNSHOT
: TE_GUNSHOTQUAD
: TE_SPIKE
: TE_SPIKEQUAD
: TE_SUPERSPIKE
: TE_SUPERSPIKEQUAD
: TE_WIZSPIKE
: TE_KNIGHTSPIKE
: TE_EXPLOSION
: TE_EXPLOSIONQUAD
: TE_TAREXPLOSION
: TE_TELEPORT
: TE_LAVASPLASH
: TE_SMALLFLASH
: TE_FLAMEJET
: EF_FLAME
: TE_BLOOD
: TE_SPARK
: TE_PLASMABURN
: TE_TEI_G3
: TE_TEI_SMOKE
: TE_TEI_BIGEXPLOSION
: TE_TEI_PLASMAHIT
: EF_STARDUST
: TR_ROCKET
: TR_GRENADE
: TR_BLOOD
: TR_WIZSPIKE
: TR_SLIGHTBLOOD
: TR_KNIGHTSPIKE
: TR_VORESPIKE
: TR_NEHAHRASMOKE
: TR_NEXUIZPLASMA
: TR_GLOWTRAIL
: SVC_PARTICLE

==Console variables==
{{cvar|r_drawparticles|toggle drawing of all particles}}
{{cvar|r_drawparticles_drawdistance|set a maximal distance to draw particles at}}
{{cvar|cl_particles_size|this will scale a size of all particles}}
{{cvar|cl_particles_quality|multiplier of particles count spawned by emitters, better quality &lt;nowiki&gt;= more particles (1 - min, 4 - max. quality)&lt;/nowiki&gt;}}
{{cvar|cl_particles_reloadeffects|reloads effectinfo.txt while in the game; that eliminates a need to quit and restart DP to see updated effects}}

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces engine</title>
    <ns>0</ns>
    <id>158</id>
      <sha1>qj3qvv9epmq46nx61vlrdu49jojkeqr</sha1>
    <revision>
      <id>1959</id>
      <timestamp>2012-07-27T12:20:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVe...&quot;</comment>
      <text xml:space="preserve" bytes="4875">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

This is rough feature list written by Forest &quot;LordHavoc&quot; Hale.

==Basic features==
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

==Renderer==
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

==Physics==
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

==Scripting==
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

==Sound==
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

==Input Devices==
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

==Network==
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

== Tools ==
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

[[Category:Darkplaces engine]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1960</id>
      <timestamp>2012-07-27T12:21:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4879">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

==Basic features==
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

==Renderer==
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

==Physics==
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

==Scripting==
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

==Sound==
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

==Input Devices==
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

==Network==
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

== Tools ==
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

[[Category:Darkplaces engine]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2272</id>
      <timestamp>2012-07-30T20:39:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4892">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

==Basic features==
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

==Renderer==
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

==Physics==
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

==Scripting==
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

==Sound==
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

==Input Devices==
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

==Network==
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

== Tools ==
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

[[Category:Darkplaces engine]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2400</id>
      <timestamp>2012-08-03T06:43:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4928">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

===Basic features===
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

===Renderer===
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

===Physics===
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

===Scripting===
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

===Sound===
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

===Input Devices===
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

===Network===
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

===Tools===
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

[[Category:Darkplaces engine]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2401</id>
      <timestamp>2012-08-03T06:43:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Darkplaces features]] to [[Darkplaces engine]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="4928">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

===Basic features===
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

===Renderer===
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

===Physics===
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

===Scripting===
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

===Sound===
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

===Input Devices===
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

===Network===
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

===Tools===
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

[[Category:Darkplaces engine]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2406</id>
      <timestamp>2012-08-03T06:56:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5387">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

===Basic features===
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

===Renderer===
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

===Physics===
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

===Scripting===
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

===Sound===
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

===Input Devices===
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

===Network===
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

===Tools===
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
== Free Games ==
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic]
* [http://www.alientrap.org/nexuiz/ GPL Nexuiz]
== Commercial Games==
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]

[[Category:Darkplaces engine]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2407</id>
      <timestamp>2012-08-03T06:56:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5377">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

===Basic features===
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

===Renderer===
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting.
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

===Physics===
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

===Scripting===
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

===Sound===
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

===Input Devices===
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

===Network===
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

===Tools===
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
== Free Games ==
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic]
* [http://www.alientrap.org/nexuiz/ GPL Nexuiz]
== Commercial Games==
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2408</id>
      <timestamp>2012-08-03T06:57:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5418">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
== Free Games ==
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic]
* [http://www.alientrap.org/nexuiz/ GPL Nexuiz]
== Commercial Games==
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2409</id>
      <timestamp>2012-08-03T06:57:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5419">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
===Free Games===
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic]
* [http://www.alientrap.org/nexuiz/ GPL Nexuiz]
===Commercial Games===
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2410</id>
      <timestamp>2012-08-03T06:58:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5427">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
===Free Games===
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic]
* [http://www.alientrap.org/nexuiz/ GPL Nexuiz]
===Commercial Games===
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2411</id>
      <timestamp>2012-08-03T08:02:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Community */</comment>
      <text xml:space="preserve" bytes="5436">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
===Free Games===
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic]
* [http://www.alientrap.org/nexuiz/ GPL Nexuiz]
===Commercial Games===
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2412</id>
      <timestamp>2012-08-03T08:19:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Games */</comment>
      <text xml:space="preserve" bytes="5564">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
===Free Games===
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
===Commercial Games===
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2413</id>
      <timestamp>2012-08-03T08:20:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Games */</comment>
      <text xml:space="preserve" bytes="5564">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.transfusion-game.com/ Transfusion]
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2414</id>
      <timestamp>2012-08-03T08:20:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Games */</comment>
      <text xml:space="preserve" bytes="5564">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

&lt;h3&gt;Basic features&lt;/h3&gt;
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

&lt;h3&gt;Renderer&lt;/h3&gt;
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

&lt;h3&gt;Physics&lt;/h3&gt;
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

&lt;h3&gt;Scripting&lt;/h3&gt;
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

&lt;h3&gt;Sound&lt;/h3&gt;
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

&lt;h3&gt;Input Devices&lt;/h3&gt;
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

&lt;h3&gt;Network&lt;/h3&gt;
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

&lt;h3&gt;Tools&lt;/h3&gt;
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
* [http://www.transfusion-game.com/ Transfusion]
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2415</id>
      <timestamp>2012-08-03T08:22:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5700">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
* [http://www.transfusion-game.com/ Transfusion]
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer]
* [http://www.steel-storm.com/ Steel Storm]
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy]

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2426</id>
      <timestamp>2012-08-03T09:16:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6367">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
'''Gallery'''
&lt;gallery&gt;
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2431</id>
      <timestamp>2012-08-03T11:05:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6490">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
'''Gallery'''
&lt;gallery&gt;
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2432</id>
      <timestamp>2012-08-03T11:06:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Games */</comment>
      <text xml:space="preserve" bytes="6490">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2433</id>
      <timestamp>2012-08-03T11:08:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6477">{{WIP}}
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
&lt;/gallery&gt;

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2434</id>
      <timestamp>2012-08-03T11:08:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6482">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2437</id>
      <timestamp>2012-08-03T11:26:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6783">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based off GPL GLQuake engine source code released by id Software, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2438</id>
      <timestamp>2012-08-03T11:43:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6756">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2440</id>
      <timestamp>2012-08-03T11:49:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6798">DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces wraith.jpg|Wraith monster
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2445</id>
      <timestamp>2012-08-03T12:16:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6844">[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces wraith.jpg|Wraith monster
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2446</id>
      <timestamp>2012-08-03T12:18:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6856">[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces wraith.jpg|Wraith monster
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{grammar}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2447</id>
      <timestamp>2012-08-03T12:18:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6856">{{grammar}}
[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces wraith.jpg|Wraith monster
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2456</id>
      <timestamp>2012-08-03T13:55:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6908">{{grammar}}
[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces e1m1 retextured.jpg|E1M1 retextured
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces wraith.jpg|Wraith monster
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2457</id>
      <timestamp>2012-08-03T13:56:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6840">{{grammar}}
[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces e1m1 retextured.jpg|E1M1 retextured
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces wraith.jpg|Wraith monster
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2458</id>
      <timestamp>2012-08-03T13:58:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6851">{{grammar}}
[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://www.moddb.com/games/stealer-guy/ Stealer Guy] - A game being developed by Chris Page
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces e1m1 retextured.jpg|E1M1 retextured
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces wraith.jpg|Wraith monster retextured
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2460</id>
      <timestamp>2012-08-03T14:57:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6756">{{grammar}}
[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces e1m1 retextured.jpg|E1M1 retextured
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces wraith.jpg|Wraith monster retextured
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2461</id>
      <timestamp>2012-08-03T15:52:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6801">{{imported|http://modding.kot-in-action.com/index.html}}
[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces e1m1 retextured.jpg|E1M1 retextured
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces wraith.jpg|Wraith monster retextured
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2464</id>
      <timestamp>2012-08-03T17:38:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6744">[[File:Darkplaces logo.png|alt=|link=|right]]
DarkPlaces game engine encompasses more than 10 years of research and development in the field of real-time game engine technology by Forest &quot;LordHavoc&quot; Hale and Rudolf &quot;divVerent&quot; Polzer. 

Based on id Software Quake technology, DarkPlaces Game Engine is one of the most solid and robust 3D engines available. It lets you to unleash your creative potential at virtually no cost. Being an open source 3D game engine under the GPL license, it only requires you to credit its creator and share the fixes and new implementations you might have made for your application or game.

==Features overview==
This is rough feature overview written by Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Basic features&lt;/font&gt;'''
* Supported Platforms: '''Windows''', '''Mac OS X''', '''Linux'''
* Future Platforms: '''iOS''', '''Android (in development)'''.
* SIMD optimizations: '''SSE''', '''SSE2'''.
* Support for 32-bit and 64-bit architectures for Windows, Mac OS X and Linux.
* Statistics and debugging features for tracking memory usage, textures, models and other assets.
* Fully automated save/restore game system as part of the QuakeC Virtual Machine.
* Compressed zip archive loading and automatic downloads via CURL library.
* BlindID user hash generation for online leaderboards.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supported: Direct3D 9 Shader Model 3 (in development), OpenGL (all versions), OpenGL ES 2.0, and software rasterizer.
* Broad range of performance and tuning options allow the renderer to work on very old and new video cards.
* 64-bit Color HDR Rendering.
* Anti-aliasing and coverage sampling.
* OpenGL Quad-Buffer Stereo 3D rendering.
* NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround compatible (Direct3D 9 only).
* NVIDIA SLI compatible.
* AMD CrossFire compatible.
* Dynamic per pixel lighting with shadowmaps or stencil shadow volumes
* Photon-mapping global illumination (static or dynamic).
* Compiled lightmaps with bump and specular features.
* Normal mapping and Specular mapping with per-pixel hardness.
* Offsetmapping and Reliefmapping.
* sRGB tonemapping.
* Deferred lighting (in development).
* Glow textures.
* Support for Quake 3 Arena 'shaders'.
* Customizable particle system (effectinfo files as well as QuakeC scripting).
* Motion blur.
* Normal mapped environment cubemap reflections.
* Dynamic water reflection and distortion effects and Fresnel factor.
* Decal system with support for animated models.
* Quake bsp and Quake 3 Arena bsp level support.
* Skeletal model formats supported: '''IQM''' (recommended to use), '''DPM''' (compiled from HL2 SMD files or Doom 3 MD5 files), Unreal '''PSK/PSA'''.
* Non-Skeletal Model: '''Quake MDL''', '''Quake 2 MD2''', '''Quake 3 [[MD3]]''', OBJ.
* Textures: [[DDS]], [[TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Physics&lt;/font&gt;'''
* Open Dynamics Engine for real-time physics simulations of rigid bodies, cloth (in development), ragdolls (in development).
* Internal Quake physics with advanced high-performance collision engine (swept-box collisions and trimesh support, [[BIH | Bounding Interval Hierarchy]] culling technology).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Powerful high performance scripting language QuakeC (similar to C language syntax) supports server side, client side and menu GUI scripting. Such features as Portal rendering (indoor), Model Level of Detail (LOD) system, clutter objects, impostors, seamless world, advanced AI, advanced in-game GUI, procedurally generated levels and many other features can be achieved entirely in script.
* Virtual machine with full state saving/restoring and networking as basic features.
* QuakeC supports localized multilingual text, and automatic console variable access.
* Graphic User Interface
* TTF and OTF fonts support (using Freetype library).
* Unicode (UTF8) support.
* Built-in support for standard .po translation files for localization of text.
* Advanced menu and in-game GUI creation via QuakeC.

'''&lt;font size=3&gt;Sound&lt;/font&gt;'''
* OGG Vorbis (for sounds as well as music), WAV and CD Audio playback.
* Doppler and pitch shifting effects (achievable through QuakeC scripting).

'''&lt;font size=3&gt;Input Devices&lt;/font&gt;'''
* PC/Mac keyboards and mice.
* Xbox 360 gamepad.
* Standard PC joysticks and gamepads.
* Multi-touch screens (in development).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Advanced networking protocol with distance-based priority system allowing thousands of entities visible at once.
* QuakeC code can provide custom networking for even more optimal bandwidth usage and prediction.
* Automatic zip archive downloads via CURL library as specified by game server.
* Automatic Client Side QuakeC code download when playing on modified servers.
* Server-side traceline culling to block wallhack cheats.

'''&lt;font size=3&gt;Tools&lt;/font&gt;'''
* Compatible with NetRadiant level editor.
* Blender and other modeling apps have various ways to get content into the engine (IQM, SMD from HL2 exporters, Unreal PSK/PSA files, md5mesh+anim can be converted as well).

==Community==
* [http://quakeone.com/ QuakeOne] - Quake 1 Resurrection portal
* [http://www.inside3d.com/ Inside3D] - Quake's most active developers portal dedicated to modding and QuakeC coding

==Games==
'''Free Games'''
* [http://www.xonotic.org/ Xonotic] - Fast-paced multiplayer first person shooter
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Xonotic predecessor
'''Commercial Games'''
* [http://www.retroblazer.com/ Retro Blazer] - First person shooter that reminicent and a tribute to older shooters such as Doom and Quake
* [http://www.steel-storm.com/ Steel Storm] - Top-down arcade shooter released on Steam
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Medieval style dungeon crawl game

'''Gallery'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - 2d platformer game
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Some custom map
File:Darkplaces quake.png|Quake with high resolution textures
File:Darkplaces e1m1 retextured.jpg|E1M1 retextured
File:Darkplaces darsana.jpg|Darsana - medieval style multiplayer game
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake of game 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - zombie fan game
File:Darkplaces honeycomb.jpg|Honeycomb - a Quake custom level
File:Darkplaces wraith.jpg|Wraith monster retextured
&lt;/gallery&gt;

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces lighting</title>
    <ns>0</ns>
    <id>159</id>
      <sha1>fu7f6lr1bt8j9xqm2e25n96trh7s54q</sha1>
    <revision>
      <id>1963</id>
      <timestamp>2012-07-27T12:23:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{article unfinished}} Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.  == Light met...&quot;</comment>
      <text xml:space="preserve" bytes="4726">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - not a lighting but shadowing method where each entity cast one shadow on the floor
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating bmodels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly (bright orange = lots of passes, slow)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly (bright blue = lots of passes, slow). Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1964</id>
      <timestamp>2012-07-27T12:24:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4726">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - not a lighting but shadowing method where each entity cast one shadow on the floor
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly (bright orange = lots of passes, slow)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly (bright blue = lots of passes, slow). Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1965</id>
      <timestamp>2012-07-27T12:25:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console variables */</comment>
      <text xml:space="preserve" bytes="4760">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - not a lighting but shadowing method where each entity cast one shadow on the floor
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1966</id>
      <timestamp>2012-07-27T12:29:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="5394">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - not a lighting but shadowing method where each entity cast one shadow on the floor
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1967</id>
      <timestamp>2012-07-27T12:30:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light methods and effects */</comment>
      <text xml:space="preserve" bytes="5374">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1968</id>
      <timestamp>2012-07-27T12:31:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="5374">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1969</id>
      <timestamp>2012-07-27T12:32:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="5828">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Light effects'''
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Light cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1970</id>
      <timestamp>2012-07-27T12:35:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6408">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Light effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=red&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1971</id>
      <timestamp>2012-07-27T12:36:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6412">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Light effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Light up'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1972</id>
      <timestamp>2012-07-27T12:36:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6417">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Light effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1973</id>
      <timestamp>2012-07-27T12:37:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6425">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1974</id>
      <timestamp>2012-07-27T12:38:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Shadow mapping vs Stencil shadows */</comment>
      <text xml:space="preserve" bytes="6427">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* Phong lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied 

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1975</id>
      <timestamp>2012-07-27T12:42:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light models */</comment>
      <text xml:space="preserve" bytes="6471">{{article unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1999</id>
      <timestamp>2012-07-27T14:01:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6463">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - low frequency static lighting, aimed at big counts of simple surfaces
* Lightmaps - high frequency static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - low frequency static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2044</id>
      <timestamp>2012-07-27T15:27:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light methods and effects */</comment>
      <text xml:space="preserve" bytes="6420">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled by didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2045</id>
      <timestamp>2012-07-27T15:27:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light models */</comment>
      <text xml:space="preserve" bytes="6421">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volumes and is considered to replace them:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2046</id>
      <timestamp>2012-07-27T15:28:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Shadow mapping vs Stencil shadows */</comment>
      <text xml:space="preserve" bytes="6428">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Supports LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2047</id>
      <timestamp>2012-07-27T15:29:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Shadow mapping vs Stencil shadows */</comment>
      <text xml:space="preserve" bytes="6434">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic lighting model used on all methods
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2048</id>
      <timestamp>2012-07-27T15:30:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6426">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phons lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2049</id>
      <timestamp>2012-07-27T15:30:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light models */</comment>
      <text xml:space="preserve" bytes="6426">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Toon shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2050</id>
      <timestamp>2012-07-27T15:30:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light models */</comment>
      <text xml:space="preserve" bytes="6425">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced in realtime
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2051</id>
      <timestamp>2012-07-27T15:31:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light methods and effects */</comment>
      <text xml:space="preserve" bytes="6428">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced by QuakeC code
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2052</id>
      <timestamp>2012-07-27T15:31:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light methods and effects */</comment>
      <text xml:space="preserve" bytes="6425">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not ideally sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2053</id>
      <timestamp>2012-07-27T15:32:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Shadow mapping vs Stencil shadows */</comment>
      <text xml:space="preserve" bytes="6417">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2054</id>
      <timestamp>2012-07-27T15:34:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6423">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2055</id>
      <timestamp>2012-07-27T15:34:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6429">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

== See also ==
* [[Per-pixel lighting]]

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2056</id>
      <timestamp>2012-07-27T15:34:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6388">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* Vertex lighting - static lighting, aimed at big counts of simple surfaces
* Lightmaps - static lighting, aimed at surfaces that receives shadows from static objects
* Lightgrid - static lighting, aimed at moving entities
* Realtime lighting - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2057</id>
      <timestamp>2012-07-27T15:35:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light methods and effects */</comment>
      <text xml:space="preserve" bytes="6415">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - fully dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2058</id>
      <timestamp>2012-07-27T18:11:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Light methods and effects */</comment>
      <text xml:space="preserve" bytes="6414">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2143</id>
      <timestamp>2012-07-29T13:48:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6557">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2144</id>
      <timestamp>2012-07-29T13:50:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6557">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=#030&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2145</id>
      <timestamp>2012-07-29T13:50:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6558">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Small&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2146</id>
      <timestamp>2012-07-29T13:51:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6558">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precompulation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2147</id>
      <timestamp>2012-07-29T13:52:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Comparison of different lighting methods */</comment>
      <text xml:space="preserve" bytes="6558">{{unfinished}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precomputation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2148</id>
      <timestamp>2012-07-29T13:53:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6578">{{unfinished}}
{{need screenshot}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precomputation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2187</id>
      <timestamp>2012-07-29T21:09:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6590">{{unfinished}}
{{need screenshot}}
{{grammar}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Light models ==
Darkplaces using several lighting models, most of them are set globally:

* [http://en.wikipedia.org/wiki/Phong_shading Phong] lighting model - generic and default lighting model
* Fake light - a developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
* Cel shading - a phong lighting model with altered shading.
* Fullbright - no lighting applied

== Light methods and effects ==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* [[Realtime lighting]] - full dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

Additionaly, Darkplaces supports a number of lighting effects:
* Coronas - aimed to simulate glow around lights, which looks good on small and medium size lights
* Planar shadows - each entity cast one shadow on the floor (or by global vector)
* Customized modellight - lightgrid-sampled model lighting could be replaced with QuakeC
* Fog - global fog and global volumeric fog (with height set) are suppored

== Shadow mapping vs Stencil shadows ==
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a shadow rendering method Darkplaces used in pre-2010. Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* It is faster to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

== Comparison of different lighting methods ==
{| width=500 cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precomputation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

== Console variables ==
{{cvar|r_shadow_realtime_world|Enabled realtime lighting of world lights (stored in external .rtlights file)}}
{{cvar|r_shadow_realtime_dlight|Enabled realtime lighting of dynamic lights (created by entities)}}

{{cvar|r_shadow_*|A group of cvars to control realtime lighting}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping which replaces default shadow volume-based lighting}}
{{cvar|r_shadow_shadowmapping_*|A group of cvars to control shadowmapping}}
{{cvar|r_shadows_*|A group of cvars to control planar shadows}}
{{cvar|r_showlighting|Show areas lit by dynamic lightsources. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright orange = lots of passes, slow)&lt;/nowiki&gt;}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2475</id>
      <timestamp>2012-08-05T20:03:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Added more info</comment>
      <text xml:space="preserve" bytes="23300">{{unfinished}}
{{need screenshot}}
{{grammar}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Lighting model ==
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be processed for each pixel:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

===Attenuation===
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

===Shading===
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

===Specular===
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

===Shadows===
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

====Stencil shadows====
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

====Shadowmapping====
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

===Other light models===
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

==Light methods==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* Dynamic lighting - full realtime dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

'''Comparison of different lighting methods'''
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precomputation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

==Light effects==
Darkplaces supports a number of special lighting effects.

===Light styles===
Stub!

===Light coronas===
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

===Light cubemap filtering===
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

===Planar shadows===
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

Blood Omicide using planar shadows to simulate sunlight in outdoor locations.

{{hidden begin|Console variables}}
{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}
{{hidden end}}

===Customized modellight===
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client Side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

===Fog===
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following components:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

== Tweaking ==
Darkplaces lighting renderer have a bunch of misc options to tweak.
=== Optimizations ===
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

===Light attenuation===
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

== Getting lights on the map ==
Engine supports two ways to get lights on the map.

{{tip|For Blood Omnicide, this settings are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

===World lights===
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

Blood Omnicide tips:
{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}

=== Dynamic lights ===
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

== Galleries ==
=== Per-pixel lighting ===
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Gloss
File:Darkplaces lightexample bouncegrid.jpg|+ BounceGrid
&lt;/gallery&gt;

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2476</id>
      <timestamp>2012-08-05T20:07:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="23374">{{unfinished}}
{{need screenshot}}
{{grammar}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Lighting model ==
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be processed for each pixel:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

===Attenuation===
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

===Shading===
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

===Specular===
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

===Shadows===
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

====Stencil shadows====
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

====Shadowmapping====
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

===Other light models===
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

==Light methods==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* Dynamic lighting - full realtime dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

'''Comparison of different lighting methods'''
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precomputation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

==Light effects==
Darkplaces supports a number of special lighting effects.

===Light styles===
Stub!

===Light coronas===
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

===Light cubemap filtering===
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

===Planar shadows===
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

Blood Omicide using planar shadows to simulate sunlight in outdoor locations.

{{hidden begin|Console variables}}
{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}
{{hidden end}}

===Customized modellight===
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client Side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

===Fog===
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following components:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

== Tweaking ==
Darkplaces lighting renderer have a bunch of misc options to tweak.
=== Optimizations ===
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

===Light attenuation===
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

== Getting lights on the map ==
Engine supports two ways to get lights on the map.

===World lights===
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

Blood Omnicide tips:
{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}
{{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

=== Dynamic lights ===
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

== Galleries ==
=== Per-pixel lighting ===
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Gloss
File:Darkplaces lightexample bouncegrid.jpg|+ BounceGrid
&lt;/gallery&gt;

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2478</id>
      <timestamp>2012-08-05T20:20:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="23794">{{unfinished}}
{{need screenshot}}
{{grammar}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for.

== Lighting model ==
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be processed for each pixel:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

===Attenuation===
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

===Shading===
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to export deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

===Specular===
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

===Shadows===
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

====Stencil shadows====
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

====Shadowmapping====
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

===Other light models===
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

==Light methods==
There is 4 lighting methods used in Darkplaces:

* [[Vertex lighting]] - static lighting, aimed at big counts of simple surfaces
* [[Lightmap | Lightmaps]] - static lighting, aimed at surfaces that receives shadows from static objects
* [[Lightgrid]] - static lighting, aimed at moving entities
* Dynamic lighting - full realtime dynamic lighting (each light is a separate pass), aimed at switchable and moving lightsources that lights moving entities

'''Comparison of different lighting methods'''
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% | Task 
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
! width=15% | Realtime lighting
|-
| Details
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
|-
| Render speed
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=green&gt;Fast&lt;/font&gt;
| &lt;font color=green&gt;Fastest&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Precomputation time
| &lt;font color=green&gt;Short&lt;/font&gt;
| &lt;font color=red&gt;Long&lt;/font&gt;
| &lt;font color=orange&gt;Medium&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| RAM usage
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=red&gt;High&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
| &lt;font color=green&gt;Low&lt;/font&gt;
|-
| Shadows
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Penumbra
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
|-
| Number of lights
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=green&gt;Large&lt;/font&gt;
| &lt;font color=red&gt;Small&lt;/font&gt;
|-
| colspan=5 | '''Surface-based effects'''
|-
| Bumpmapping
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Specular
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Cubemap filters
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Partial&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Per-light diffuse/ambient/specular scale
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Non-point 'area' lights
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
|-
| Light styles
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving lights
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| colspan=5 | '''Global illumination'''
|-
| Precomputation time
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=red&gt;Very long&lt;/font&gt;
| &lt;font color=orange&gt;Long&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
|-
| Rendering speed
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=black&gt;N/A&lt;/font&gt;
| &lt;font color=red&gt;Slow&lt;/font&gt;
|-
| Quality
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=green&gt;High&lt;/font&gt;
| &lt;font color=red&gt;Low&lt;/font&gt;
|-
| colspan=5 | '''Used to light'''
|-
| Map surfaces
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Static BModels
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Moving/rotating BModels
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=orange&gt;Optional&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|-
| Animated models
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=red&gt;No&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
| &lt;font color=green&gt;Yes&lt;/font&gt;
|}

==Light effects==
Darkplaces supports a number of special lighting effects.

===Light styles===
Stub!

===Light coronas===
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

===Light cubemap filtering===
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

===Planar shadows===
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

Blood Omicide using planar shadows to simulate sunlight in outdoor locations.

{{hidden begin|Console variables}}
{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}
{{hidden end}}

===Customized modellight===
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client Side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

===Fog===
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following components:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

== Tweaking ==
Darkplaces lighting renderer have a bunch of misc options to tweak.
=== Optimizations ===
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

===Light attenuation===
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

== Getting lights on the map ==
Engine supports two ways to get lights on the map.

===World lights===
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

Blood Omnicide tips:
{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}
{{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

=== Dynamic lights ===
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

== Galleries ==
=== Per-pixel lighting ===
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Gloss
File:Darkplaces lightexample bouncegrid.jpg|+ BounceGrid
&lt;/gallery&gt;

[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2490</id>
      <timestamp>2012-08-05T21:08:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="714">{{unfinished}}
{{grammar}}
Darkplaces engine uses combined lighting model. Several lighting methods are implemented to give best results at cases they are aimed for. There is lots of tricks and options for lighting renderer. Clever usage of them will help designers to make fast-to-render and pretty maps.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Darkplaces lighting model]]
#[[Darkplaces lighting/Lighting methods|Lighting methods]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2492</id>
      <timestamp>2012-08-05T21:15:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="857">{{unfinished}}
{{grammar}}
Lighting is one of the most important things to level design.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options for lighting renderer. Clever usage of them will help designers to make fast-to-render and pretty maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Darkplaces lighting model]]
#[[Darkplaces lighting/Lighting methods|Lighting methods]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2501</id>
      <timestamp>2012-08-08T13:58:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="787">{{unfinished}}
{{grammar}}
Lighting is one of the most important things to level design.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options for lighting renderer. Clever usage of them will help designers to make fast-to-render and pretty maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Lighting model]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2502</id>
      <timestamp>2012-08-08T13:59:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="948">{{unfinished}}
{{grammar}}
Lighting is one of the most important things to level design.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options for lighting renderer. Clever usage of them will help designers to make fast-to-render and pretty maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Lighting model]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

== Recommemded articles ==
* [http://www.moddb.com/tutorials/lighting-in-game-environments-the-hows-and-whys Lighting in game environments - the hows and whys]

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2508</id>
      <timestamp>2012-08-09T07:26:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1003">[[File:Darkplaces_gl_lightmaps_2.jpg|400px|thumb|Map with only lighting applied]]
Lighting is one of the most important things to level design.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options for lighting renderer. Clever usage of them will help designers to make fast-to-render and pretty maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Lighting model]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

== Recommemded articles ==
* [http://www.moddb.com/tutorials/lighting-in-game-environments-the-hows-and-whys Lighting in game environments - the hows and whys]

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2510</id>
      <timestamp>2012-08-09T07:34:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1522">[[File:Darkplaces_gl_lightmaps_2.jpg|400px|thumb|Map with only lighting applied]]
Lighting is one of the most important and influential elements in level design. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options and tricks. Clever usage of them will help designers to make fast-to-render and well themed maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

'''Important Note'''

Textures are the base for lighting. Before starting to learn how lighting works, be sure to check out [[Darkplaces material system]] as many of it's concepts and features used by lighting too.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Lighting model]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

== Recommemded articles ==
* [http://www.moddb.com/tutorials/lighting-in-game-environments-the-hows-and-whys Lighting in game environments - the hows and whys]

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2538</id>
      <timestamp>2012-08-09T14:16:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>fix a typo</comment>
      <text xml:space="preserve" bytes="1522">[[File:Darkplaces_gl_lightmaps_2.jpg|400px|thumb|Map with only lighting applied]]
Lighting is one of the most important and influential elements in level design. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options and tricks. Clever usage of them will help designers to make fast-to-render and well themed maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

'''Important Note'''

Textures are the base for lighting. Before starting to learn how lighting works, be sure to check out [[Darkplaces material system]] as many of it's concepts and features used by lighting too.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Lighting model]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
#[[Darkplaces lighting/Tweaking|Tweaking]]
&lt;/font&gt;

== Recommended articles ==
* [http://www.moddb.com/tutorials/lighting-in-game-environments-the-hows-and-whys Lighting in game environments - the hows and whys]

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2563</id>
      <timestamp>2012-08-09T14:51:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1575">[[File:Darkplaces_gl_lightmaps_2.jpg|400px|thumb|Map with only lighting applied]]
Lighting is one of the most important and influential elements in level design. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces engine combines several lighting techiques in order to get best performance and best looks. Because of that there is lots of options and tricks. Clever usage of them will help designers to make fast-to-render and well themed maps.

This reference will guide you in the deep dungeon of Darkplaces lighting methods, effects, tricks and quirks.

'''Important Note'''

Textures are the base for lighting. Before starting to learn how lighting works, be sure to check out [[Darkplaces material system]] as many of it's concepts and features used by lighting too.

==Chapters==
&lt;font size=3&gt;
#[[Darkplaces lighting/Introduction|Introduction]]
#[[Darkplaces lighting/Lighting model|Lighting model]]
#[[Darkplaces lighting/Special effects|Special effects]]
#[[Darkplaces lighting/Light sources|Light sources]]
&lt;/font&gt;

==Appendix==
&lt;font size=3&gt;
* [[Darkplaces lighting/Additional options|Additional options]]
&lt;/font&gt;

==Recommended articles==
* [http://www.moddb.com/tutorials/lighting-in-game-environments-the-hows-and-whys Lighting in game environments - the hows and whys]

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces lighting/Additional options</title>
    <ns>0</ns>
    <id>237</id>
      <sha1>er61x6cj5b5z6kak2jes1pcdxr9hht8</sha1>
    <revision>
      <id>2488</id>
      <timestamp>2012-08-05T21:07:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Light sources}} Darkplaces lighting renderer have a bunch of misc options to tweak. === Optimizations === For best performance, all optimisations should be ...&quot;</comment>
      <text xml:space="preserve" bytes="1072">{{navigation title|Light sources}}
Darkplaces lighting renderer have a bunch of misc options to tweak.
=== Optimizations ===
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

===Light attenuation===
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2489</id>
      <timestamp>2012-08-05T21:07:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1066">{{navigation title|Light sources}}
Darkplaces lighting renderer have a bunch of misc options to tweak.
==Optimizations==
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

==Light attenuation==
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2560</id>
      <timestamp>2012-08-09T14:49:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Darkplaces lighting/Tweaking]] to [[Darkplaces lighting/Additional renderer options]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="1066">{{navigation title|Light sources}}
Darkplaces lighting renderer have a bunch of misc options to tweak.
==Optimizations==
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

==Light attenuation==
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2561</id>
      <timestamp>2012-08-09T14:49:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1053">{{navigation title|}}
Darkplaces lighting renderer have a bunch of misc options to tweak.
==Optimizations==
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

==Light attenuation==
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2562</id>
      <timestamp>2012-08-09T14:50:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Darkplaces lighting/Additional renderer options]] to [[Darkplaces lighting/Additional options]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="1053">{{navigation title|}}
Darkplaces lighting renderer have a bunch of misc options to tweak.
==Optimizations==
For best performance, all optimisations should be on.

{{cvar|r_shadow_scissor|Use scissor optimization of light rendering (restricts rendering to the portion of the screen affected by the light)}}
{{cvar|r_shadow_sortsurfaces|Improve performance by sorting illuminated surfaces by texture}}
{{cvar|r_shadow_usebihculling|Use [[BIH | Bounding Interval Hierarchy]] for culling lit surfaces instead of [[BSP|Binary Space Partitioning]]}}

==Light attenuation==
This console variables change attenuation for all dynamic lights.

{{cvar|r_shadow_lightattenuationdividebias|Controls the speed of light fading, 1 is default linear fade.}}
{{cvar|r_shadow_lightattenuationlinearscale|Linear scale applied during attenuation, larger values will make lesser half-light zones}}
{{cvar|r_shadow_lightintensityscale|Renders all lights brighter or darker}}
{{cvar|r_shadow_lightradiusscale|Renders all world lights larger or smaller}}

{{navigation footer|}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces lighting/Introduction</title>
    <ns>0</ns>
    <id>233</id>
      <sha1>3putcims28ezl61xtdctprkdc2hmuct</sha1>
    <revision>
      <id>2480</id>
      <timestamp>2012-08-05T20:41:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|}} Trivia {{navigation footer|Lighting model}}&quot;</comment>
      <text xml:space="preserve" bytes="65">{{navigation title|}}
Trivia
{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2491</id>
      <timestamp>2012-08-05T21:08:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="395">{{navigation title|}}
== Galleries ==
=== Per-pixel lighting ===
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Gloss
File:Darkplaces lightexample bouncegrid.jpg|+ BounceGrid
&lt;/gallery&gt;
{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2495</id>
      <timestamp>2012-08-08T13:34:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6651">{{navigation title|}}
{{need screenshot}}
Lighting is one of the most important and influential elements in environments. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Lighting has the capacity to bring life to a group of objects and take them to the next level of quality. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around. Its better to know them before you dig into it.

===Power has a price===
Similar to material system, Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2496</id>
      <timestamp>2012-08-08T13:55:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10931">{{navigation title|}}
{{need screenshot}}
Lighting is one of the most important and influential elements in environments. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Lighting has the capacity to bring life to a group of objects and take them to the next level of quality. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around. Its better to know them before you dig into it.

===Power has a price===
Similar to material system, Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:


'''Comparison of different lighting methods'''
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Per'''-'''light diffuse/ambient/specular scale
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2497</id>
      <timestamp>2012-08-08T13:56:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10882">{{navigation title|}}
{{need screenshot}}
Lighting is one of the most important and influential elements in environments. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Lighting has the capacity to bring life to a group of objects and take them to the next level of quality. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around. Its better to know them before you dig into it.

===Power has a price===
Similar to material system, Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Per'''-'''light diffuse/ambient/specular scale
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2504</id>
      <timestamp>2012-08-08T14:04:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Key Concepts */</comment>
      <text xml:space="preserve" bytes="10834">{{navigation title|}}
{{need screenshot}}
Lighting is one of the most important and influential elements in environments. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Lighting has the capacity to bring life to a group of objects and take them to the next level of quality. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Similar to material system, Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Per'''-'''light diffuse/ambient/specular scale
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2505</id>
      <timestamp>2012-08-08T14:05:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Key Concepts */</comment>
      <text xml:space="preserve" bytes="10588">{{navigation title|}}
{{need screenshot}}
Lighting is one of the most important and influential elements in environments. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Lighting has the capacity to bring life to a group of objects and take them to the next level of quality. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Similar to material system, Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2506</id>
      <timestamp>2012-08-08T14:07:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Key Concepts */</comment>
      <text xml:space="preserve" bytes="10560">{{navigation title|}}
{{need screenshot}}
Lighting is one of the most important and influential elements in environments. It has the power to make or break the visuals, theme and atmosphere. Lighting is just as important as geometry. Without lighting there is no environment but just a group of 3-dimensional objects. Lighting has the capacity to bring life to a group of objects and take them to the next level of quality. Its purpose goes further than just giving the players the ability to see where they are going.

Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2509</id>
      <timestamp>2012-08-09T07:26:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10082">{{navigation title|}}
{{need screenshot}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2511</id>
      <timestamp>2012-08-09T07:44:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10062">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (like spawning of a flame effect). But for map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2716</id>
      <timestamp>2012-10-07T10:46:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static lightsources */</comment>
      <text xml:space="preserve" bytes="10105">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
There is some special lightsources that is using render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are fake lights.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2717</id>
      <timestamp>2012-10-07T10:47:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Fake lightsources */</comment>
      <text xml:space="preserve" bytes="10104">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==
This is some key concepts Darkplaces lightning system was build around.

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2718</id>
      <timestamp>2012-10-07T10:48:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Key Concepts */</comment>
      <text xml:space="preserve" bytes="10032">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. THe trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2719</id>
      <timestamp>2012-10-07T10:50:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10032">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| RAM
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2722</id>
      <timestamp>2012-10-07T10:56:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10040">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2723</id>
      <timestamp>2012-10-07T10:57:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10069">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light simulation)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2724</id>
      <timestamp>2012-10-07T10:57:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10058">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good)
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2725</id>
      <timestamp>2012-10-07T10:58:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10103">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | ''Features (1 - bad, 2 - average, 3 - good, 4 - very good'''
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Surface-based effects (+ : Supported, - : Not supported)'''
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2726</id>
      <timestamp>2012-10-07T10:59:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10104">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | '''Features (1 - bad, 2 - average, 3 - good, 4 - very good'''
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Surface-based effects (+ : Supported, - : Not supported)'''
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | '''Used to illuminate'''
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2727</id>
      <timestamp>2012-10-07T10:59:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10086">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects (+ : Supported, - : Not supported)
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | Used to illuminate
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''-'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>2728</id>
      <timestamp>2012-10-07T10:59:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10086">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around it. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects (+ : Supported, - : Not supported)
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | Used to illuminate
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>3592</id>
      <timestamp>2013-02-15T06:40:23Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="10083">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static to. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects (+ : Supported, - : Not supported)
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | Used to illuminate
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>3593</id>
      <timestamp>2013-02-15T06:43:47Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10084">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static too. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features if different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects (+ : Supported, - : Not supported)
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | Used to illuminate
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
    <revision>
      <id>3594</id>
      <timestamp>2013-02-15T09:46:32Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Static vs Dynamic */</comment>
      <text xml:space="preserve" bytes="10084">{{navigation title|}}
Darkplaces lighting is a quite complex system that have connections with many other engine systems (such as gamecode, clientcode, materials, maps etc.). Each effect (normalmapping, specular, fog, cubemap filter, style etc.) are optional and can be customized on per-object base. This gives an very huge amount of options and rendering tricks.

==What is a light==
In Darkplaces engine, light is entity that engine or compiler use to illuminate objects around. Light's entity keys are options. There is three type of light sources: '''static''', '''dynamic''' and '''fake'''.

===Static lightsources===
Entity which classname begins with &quot;light&quot; is static lightsource. Usually its just classname &quot;light&quot;, the differences between classnames are used to attach some additional functionality (in Quake there was light_torch, light_globe etc., Blood Omnicide dont use this). For map compiler, all &quot;light*&quot; entities are same and using same property set.

Q3map2 generates static lighting data when map is compiled. Depending on map size, it could last from few seconds to a hours of compilation. Generated textures and attributes are very fast to render and dont have any hit from lights count and radius (can have thousands of lights on a map, its just affects the compile time, not gameplay).

===Dynamic lightsources===
Dynamic lightsources are entities that get illumination generated and rendered by engine. All dynamic lights are omnidirectional, spot lights can be simulated with cubemap filter effects. Dynamic lights can illuminate moving, rotating and animating objects. There cant be many dynamic lights because they are costly to render. Too many dynlights in a scene will cause FPS drop and game slowdown.

===Fake lightsources===
A special kind of lightsources used for render tricks. They are not real lights, but just make some effects that looks like a light. This is quite grude, but also very fast (since it ignores generic lighting math). Coronas and glares are &quot;fake&quot; lightsources.

==Key Concepts==

===Power has a price===
Darkplaces lighting system gives the designer, artist and programmer a great deal of easily accessible power over the appearance and potential special effects. This power comes with price tag attached - more light effects you use, more CPU/GPU time it takes to render. Each light effect makes your videocard to process more shader instructions, some effects are very heavy shader-wise. When working with lighting, be sure to not abuse maps with lots of dynamic lightsources and effects seen at same time as this may overwhelm your videocard and significatly drop FPS. Use the static lighting as much as possible - lightmaps with deluxemaps have the same look as realtime lightsources.

===RGB color===
This is just like material system's RGB, with several exceptions and additions. RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. Unlike art programs, which shows color values between 0 and 255, Darkplaces have color mapped between 0 - 1 ('1 1 1' is white). Values lesser than 0 means negative color (assigning it to light source make it cast darkness). Values greater than 1 (overbright color) is supported too.

===Static vs Dynamic===
Darkplaces lighting is not unified. It combines several techniques in order to get best performance and visual quality. There is no need to light up whole level with hi-quality realtime lighting, as it will take too much CPU and GPU time. Small objects should receive a grude and fast lighting, while important objects should have best quality. To reach this goal, Darkplaces lighting have two parts - static lighting and dynamic lighting.

For static lighting illumination data is generated when map is being compiled. All objects that is not moving, rotating, animating, transforming in any way, by default, should be illuminated with static lighting. Also any light that is not moving, switching, animating, should be static too. The trick is that both of previous rules should be used synchronously. If there is some dynamic object with many static objects, and it cannot be lit well with static lighting, should make all scene illuminated with dynamic light.

Map compiler (for Blood Omnicide it is [[Q3Map2]]) is a tool that generates static lighting data. It is a full featured raytracer able to render non-point sources, area sources, spot lights, alpha shadows, can store light vectors in deluxemaps (in order to get normalmapping and specular working for lightmapped surfaces) etc. All this features makes static lighting to look same as dynamic, but render alot faster. There is 3 techniques available:
* [[Vertex lighting]] - lighting sampled at vertexes, most faster lighting storing only low frequency data (~2 times faster than lightmap)
* [[Lightmap | Lightmaps]] - light textures, can store high frequency data and fast to render
* [[Lightgrid]] - generated 3d grid storing lighting for moving entities (lighting are sampled at entity position)

Dynamic lighting comes from dynamic lightsources and can illuminate objects that is moving, rotating, animating, transforming in any way. It is very flexible and time consuming as it get computed in realtime, each frame. At other features like simulation of non-point sources, spotlights is less efficient with dynamic lighting because of limited computation time (it should be less than several milliseconds).

Here is the table showing features of different techniques:
{| width=500 cellspacing=0 cellpadding=2 border=1 style=&quot;border-collapse:collapse&quot;
! width=40% rowspan=2 | Task 
! width=45% colspan=3 | Static lighting
! width=15% rowspan=2 | Dynamic lighting
|-
! width=15% | Vertex&lt;br&gt;lighting
! width=15% | Lightmap
! width=15% | Lightgrid
|-
| colspan=5 align=center | Features (1 - bad, 2 - average, 3 - good, 4 - very good
|-
| Details
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Render speed
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| Memory cost
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Shadows
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
|-
| Penumbra (non-point light)
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''3'''&lt;/font&gt;
|-
| Max number of lights
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''4'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''1'''&lt;/font&gt;
|-
| colspan=5 align=center | Surface-based effects (+ : Supported, - : Not supported)
|-
| Bumpmapping
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Specular
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Light filters
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Non'''-'''point lights
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
|-
| Light styles
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving lights
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| colspan=5 align=center | Used to illuminate
|-
| Map surfaces
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Static BModels
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Moving/rotating BModels
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|-
| Animated models
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=red&gt;'''-'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
| align=center | &lt;font color=green&gt;'''+'''&lt;/font&gt;
|}

{{navigation footer|Lighting model}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces lighting/Light sources</title>
    <ns>0</ns>
    <id>236</id>
      <sha1>satkws4o5voga3ffvjmzf8v1ke9bvw0</sha1>
    <revision>
      <id>2487</id>
      <timestamp>2012-08-05T21:06:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Special effects}} Engine supports two ways to get lights on the map.  ==World lights== Worlds lights are loaded from external .rtlights file supplied with a...&quot;</comment>
      <text xml:space="preserve" bytes="3655">{{navigation title|Special effects}}
Engine supports two ways to get lights on the map.

==World lights==
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

Blood Omnicide tips:
{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}
{{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

== Dynamic lights ==
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

{{navigation footer|Tweaking}}</text>
    </revision>
    <revision>
      <id>2494</id>
      <timestamp>2012-08-08T11:39:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3655">{{navigation title|Special effects}}

==Static lightsources==

==Dynamic lightsources==

==World lights==
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

Blood Omnicide tips:
{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}
{{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

== Dynamic lights ==
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

{{navigation footer|Tweaking}}</text>
    </revision>
    <revision>
      <id>2742</id>
      <timestamp>2012-10-07T11:15:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3669">{{navigation title|Special effects}}
{{unfinished}}
==Static lightsources==

==Dynamic lightsources==

==World lights==
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

Blood Omnicide tips:
{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}
{{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

== Dynamic lights ==
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

{{navigation footer|Tweaking}}</text>
    </revision>
    <revision>
      <id>2743</id>
      <timestamp>2012-10-07T11:15:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* World lights */</comment>
      <text xml:space="preserve" bytes="3648">{{navigation title|Special effects}}
{{unfinished}}
==Static lightsources==

==Dynamic lightsources==

==World lights==
Worlds lights are loaded from external .rtlights file supplied with a map (foo.bsp will try to load foo.rtlights). If there are not .rtlights file, engine tries to load lights from a map &quot;light&quot; entities, which often is grude and terrible slow (as &quot;lights&quot; are maked for map compiler LIGHT stage raytracer, not for reatime rendering). So producing a good .rtlights folr is very first step in a process of map creation.

World lights are static, meaning they canot be moved, rotated, altered during a game.

{{tip|Blood Omnicide is using world lights to place lights for a Q3map2 LIGHT phase. So unlike Quake, which should have both &quot;light&quot; entities and .rtlights, Blood Omnicide .rtlights containins all map static lights}}

Each world light can have this parameters:
* origin : position
* angles : rotation
* color : RGB light color
* radius : radius of light in game units
* corona : corona intensity (0 to disable)
* coronasize : size of corona (this is multiplier to light radius)
* style : lights style number (see lightstyles above)
* shadows: whether to cast shadows from light
* cubemap : a path to [[cubemap]] filter texture
* ambient : ambient light intensity (ignores shading, makes lighting to be more 'flat')
* diffuse : shading light intensity (default is 1)
* specular : specular intensity (default is 1)
* normalmode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 0
* realtimemode : if this flag is set, light will be draws if cvar r_shadow_realtime_world is 1

{{tip|A combination of &lt;nowiki&gt;normalmode = 0, realtimemode = 0&lt;/nowiki&gt; to mark lights which are only appear on lightmap}}
{{tip|Light style 1 will make a dynamic lights that will not appear on lightmap}}
{{tip|Cubemap-filtered lights dont appear on lightmap}}

Console variables:
{{cvar|r_shadow_realtime_world|Enables rendering of full world lighting (whether loaded from the map, or a .rtlights file, or a .ent file, or a .lights file produced by hlight)}}
{{cvar|r_shadow_realtime_world_lightmaps|Brightness to render lightmaps when using full world lighting}}
{{cvar|r_shadow_realtime_world_shadows|Enables rendering of shadows from world lights}}
{{cvar|r_shadow_realtime_world_compile|Enables compilation of world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compileportalculling|Enables portal-based culling optimization during compilation (overrides compilesvbsp)}}
{{cvar|r_shadow_realtime_world_compileshadow|Enables compilation of shadows from world lights for higher performance rendering (shadow volumes only)}}
{{cvar|r_shadow_realtime_world_compilesvbsp|Enables [[svbsp]] optimization during compilation (slower than compileportalculling but more exact)}}
{{tip|In Blood Omnicide, this console varisables are hardcoded since its using a combination of full realtime lightning and lightmaps. Tweak this settings only for debugging purposes or if you want to break something.}}

== Dynamic lights ==
Dynamic lights are cast from entities. This could be both server-side entities such as rockets or client-side entities such as explosions.

{{cvar|r_shadow_realtime_dlight|Enables rendering of dynamic lights such as explosions and rocket light}}
{{cvar|r_shadow_realtime_dlight_portalculling|Enables portal optimization on dynamic lights}}
{{cvar|r_shadow_realtime_dlight_shadows|Enables rendering of shadows from dynamic lights}}
{{cvar|r_shadow_realtime_dlight_svbspculling|Enables svbsp optimization on dynamic lights}}

{{navigation footer|Tweaking}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces lighting/Lighting model</title>
    <ns>0</ns>
    <id>232</id>
      <sha1>fdex4ouhd5o3ix14syz5p2peze5hkxn</sha1>
    <revision>
      <id>2479</id>
      <timestamp>2012-08-05T20:40:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Introduction}} [[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for...&quot;</comment>
      <text xml:space="preserve" bytes="10840">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be processed for each pixel:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Lighting methods}}</text>
    </revision>
    <revision>
      <id>2483</id>
      <timestamp>2012-08-05T20:53:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10871">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be processed for each pixel:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Lighting methods}}
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2484</id>
      <timestamp>2012-08-05T20:54:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="10840">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be processed for each pixel:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Lighting methods}}</text>
    </revision>
    <revision>
      <id>2493</id>
      <timestamp>2012-08-06T05:14:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11250">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates, how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Lighting methods}}</text>
    </revision>
    <revision>
      <id>2498</id>
      <timestamp>2012-08-08T13:57:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11249">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates, how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special Effects}}</text>
    </revision>
    <revision>
      <id>2499</id>
      <timestamp>2012-08-08T13:57:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11249">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates, how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. Like with materials, power has a price: shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. 

{{important|Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2503</id>
      <timestamp>2012-08-08T14:03:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11209">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Basically Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates, how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2729</id>
      <timestamp>2012-10-07T11:00:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11199">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture is used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates, how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2730</id>
      <timestamp>2012-10-07T11:01:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11196">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates, how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2731</id>
      <timestamp>2012-10-07T11:01:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11195">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights that is used for lightmap calculations are opposite. They have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2732</id>
      <timestamp>2012-10-07T11:03:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Attenuation */</comment>
      <text xml:space="preserve" bytes="11141">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '128 128 255' if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' matrial keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2733</id>
      <timestamp>2012-10-07T11:05:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shading */</comment>
      <text xml:space="preserve" bytes="11165">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 &lt;font color=green&gt;// Since LightSource are only defined for dynamic lights, for all static lighting it defaults to 1&lt;/font&gt;
 DiffuseLight = LightSource.DiffuseLight;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLightAmount;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2734</id>
      <timestamp>2012-10-07T11:07:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shading */</comment>
      <text xml:space="preserve" bytes="11129">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2735</id>
      <timestamp>2012-10-07T11:08:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specular */</comment>
      <text xml:space="preserve" bytes="11242">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2736</id>
      <timestamp>2012-10-07T11:10:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specular */</comment>
      <text xml:space="preserve" bytes="11389">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2737</id>
      <timestamp>2012-10-07T11:11:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11397">{{navigation title|Introduction}}
{{wip}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2738</id>
      <timestamp>2012-10-07T11:11:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11397">{{navigation title|Introduction}}
{{WIP}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2739</id>
      <timestamp>2012-10-07T11:11:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11404">{{navigation title|Introduction}}
{{unfinished}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Photonmapping==
Stub!

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}</text>
    </revision>
    <revision>
      <id>2913</id>
      <timestamp>2012-11-23T03:18:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11526">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Base pass (lightmap/lightgrid/vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2914</id>
      <timestamp>2012-11-23T03:19:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11538">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Darkplaces lighting model involves this data to be used for each pixel illumination:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2915</id>
      <timestamp>2012-11-23T03:20:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11484">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated by [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2916</id>
      <timestamp>2012-11-23T03:20:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11487">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent mod (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2917</id>
      <timestamp>2012-11-23T03:21:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11494">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2918</id>
      <timestamp>2012-11-23T03:21:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="11503">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular exponent : intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular power : how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2919</id>
      <timestamp>2012-11-23T03:22:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specular */</comment>
      <text xml:space="preserve" bytes="11506">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. Basically its just a modifier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2920</id>
      <timestamp>2012-11-23T03:23:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specular */</comment>
      <text xml:space="preserve" bytes="11487">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is modifier to gloss RGB.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2921</id>
      <timestamp>2012-11-23T03:24:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Other light models */</comment>
      <text xml:space="preserve" bytes="11554">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular are optional and could be tweaked per-material. 

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is modifier to gloss RGB.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2922</id>
      <timestamp>2012-11-23T03:27:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specular */</comment>
      <text xml:space="preserve" bytes="11762">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is modifier to gloss RGB.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2923</id>
      <timestamp>2012-11-23T03:28:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specular */</comment>
      <text xml:space="preserve" bytes="11780">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadowmapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadowmapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadowmapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2924</id>
      <timestamp>2012-11-23T03:30:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shadows */</comment>
      <text xml:space="preserve" bytes="11819">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques: shadow volumes and shadow mapping.

===Stencil shadows===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadow mapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadow mapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2925</id>
      <timestamp>2012-11-23T03:30:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shadows */</comment>
      <text xml:space="preserve" bytes="11834">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques: stencil shadow volumes and shadow mapping.

===Stencil shadow volumes===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadow mapping===
Since 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadow mapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2926</id>
      <timestamp>2012-11-23T03:31:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shadow mapping */</comment>
      <text xml:space="preserve" bytes="11831">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques: stencil shadow volumes and shadow mapping.

===Stencil shadow volumes===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadow mapping===
In 2010 [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] was implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadow mapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2927</id>
      <timestamp>2012-11-23T03:31:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shadow mapping */</comment>
      <text xml:space="preserve" bytes="11842">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques: stencil shadow volumes and shadow mapping.

===Stencil shadow volumes===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadow mapping===
In 2010 darkplaces got [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)
* Shadow edges are not sharp

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadow mapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2928</id>
      <timestamp>2012-11-23T03:31:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Shadow mapping */</comment>
      <text xml:space="preserve" bytes="11813">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular and containing gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques: stencil shadow volumes and shadow mapping.

===Stencil shadow volumes===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadow mapping===
In 2010 darkplaces got [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadow mapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3595</id>
      <timestamp>2013-02-15T09:50:12Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="11819">{{navigation title|Introduction}}
[[File:Darkplaces lighting visualized.jpg|thumb|512px|Lighting visualized. Blue is shadow volumes, bright orange is zones being processed for dynamic realtime lighting.]]
Darkplaces uses a variation of Phong shading as a default lighting model. It is based on '''per-pixel lighting''' - a technique of computing lighting equations for each pixel independently. Renderer contains lots of tricks to allow shading to be fast and flexible. Default model is used on both GL2.0 rendering paths and pre-shader rendering paths (GL1.4), although not all lighting features are possible on pre-shader fixed rendering pipeline.

Lighting are breaked into the passes:
# Static lighting (lightmap or lightgrid or vertex lighting)
# Dynamic light 1
# Dynamic light 2
# ...
# Dynamic light X
# Photon Mapping (optional)
# Fog (optional)

Data used for each light pass:
* Vertex normal : values between vertices of pixel's triangle are interpolated using [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading]
* Color Map : base texture (best way to use [[diffuse]] texture)
* Normal Map : texture storing additional surface curvature (optionally, alpha storing height)
* Gloss Map : texture used for specular reflection. Contains gloss color (RGB) and optional exponent multiplier (alpha)
* Glow Map : texture's local luminance texture, RGB additive blended texture that entirely ignores shading
* Light Vector : vector of light direction (either calculated for realtime light or got from deluxemap [[lightmap]] component)
* Eye Vector : being computed for each pixel, this vector is used for specular calculation.

This gallery illustrates how lighting features changes the quality:
&lt;gallery&gt;
File:Darkplaces lightexample flat.jpg|Attenuation-only 'flat' lighting
File:Darkplaces lightexample shadows.jpg|+ Shadows
File:Darkplaces lightexample shading.jpg|+ Shading
File:Darkplaces lightexample specular.jpg|+ Specular
File:Darkplaces lightexample bouncegrid.jpg|+ Photonmapping
&lt;/gallery&gt;

==Attenuation==
Dynamic lights in Darkplaces engine are omnidirectional, using linear falloff.

{{design|Spotlights and projected dynamic lights could be simulated with cubemap filters.}}

Static lights can have a variety of options for controlling attenuation (this options is only used in Q3map2 LIGHT stage):
* target and radius : simulating spot lights with cone falloff
* _sun flag - infinite distance lights, constant direction
* _deviance and _samples - non-point lights

==Shading==
Shading is done by using dotproduct of light vector and pixel normal. Some ambient lighting could be added for a more smooth result.

{{important|[[lightmap|Lightmaps]] by default dont have shading since they lack light direction data. In order to make lightmaps to use whole shading cycle, map compiler tool should be configured to make deluxemaps (second lightmap set which store per-pixel light directions)}}

Rough shading algorithm explanation:
 &lt;font color=green&gt;// Surface's vertex normals are always supplied, texture normalmap is forced to default RGB '0.5 0.5 1' (same as surface normal) if not found&lt;/font&gt;
 PixelNormal = Surface.VertexNormal + Texture.NormalMap;
 &lt;font color=green&gt;// LightSource are only defined for dynamic lights&lt;/font&gt;
 &lt;font color=green&gt;// LightmapGlobal.AmbientLight is r_ambient cvar&lt;/font&gt;
 &lt;font color=green&gt;// Material.AmbientLight is set by '''dprtlightambient''' material keyword and only applicable to dynamic lights&lt;/font&gt;
 AmbientLight = LightSource.AmbientLight + LightmapGlobal.AmbientLight + Material.AmbientLight;
 if (LightSource)
     DiffuseLight = LightSource.DiffuseLight;
 else
     DiffuseLight = 1; &lt;font color=green&gt;// Static lighting&lt;/font&gt;
 Shading = dotproduct(PixelNormal, LightVector) * DiffuseLight + AmbientLight;

{{cvar|r_shadow_usenormalmap|Enables use of normalmap texture for lighting. Setting this to to will make only vertex normals to be used.}}
{{cvar|r_shadow_bumpscale_basetexture|Forces normalmap to be automatically calculated from color texture by using it as bumpmap, value controls magnitude. Requires r_restart.}}
{{cvar|r_shadow_bumpscale_bumpmap|Normalmap can be supplied as _bump texture, in this case engine converts it to normalmap on load, values is magnitude. Requires r_restart.}}
{{cvar|r_glsl_deluxemapping|Use full shading on lightmapped surfaces. A value of 2 forces deluxemap shading even if surface have no one.}}
{{cvar|r_ambient|Amount of ambient light to be added to all surfaces. Makes level brighter.}}

{{grammar}}
==Specular==
Specular (or gloss) is the mirror-like reflection of light from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. Many well-known surfaces (metal, plastic, wood) is recognized by specularity they have.

Specular offers two parameters to mess with:
* Specular multiplier: intensity of specular effect, this could be very high or very low. It is multiplier to gloss texture.
* Specular exponent: how 'sharp' gloss is, high values are used to make texture to be plastic-like, while lower ones are suitable for matte surfaces. Basically its just a modifier to gloss texture's alpha channel (which is forced to 1 if not supplied).

Gloss may be forced (see r_shadow_gloss 2 below), in this case texture, if missing its own gloss map, gets a white image for gloss map and parameters from a cvars.

Rough specular algorithm explanation:
 &lt;font color=green&gt;// Global.GlossIntensity is controlled by r_shadow_glossintensity or r_shadow_glossintensity2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossIntensityMod is set by '''dpglossintensitymod''' material keyword&lt;/font&gt;
 SpecularColor = Texture.GlossMap * Global.GlossIntensity * Material.GlossIntensityMod;
 &lt;font color=green&gt;// Global.GlossExponent is controlled by r_shadow_glossexponent or r_shadow_glossexponent2 if gloss is forced&lt;/font&gt;
 &lt;font color=green&gt;// Material.GlossExponentModis set by '''dpglossexponentmod''' material keyword&lt;/font&gt;
 if (Texture.GlossMap.Alpha)
     SpecularExponent = Texture.GlossMap.Alpha * Global.GlossExponent * Material.GlossExponentMod;
 else
     SpecularExponent = Global.GlossExponent * Material.GlossExponentMod;
 &lt;font color=green&gt;// this is rough specular calculation&lt;/font&gt;
 &lt;font color=green&gt;// optionally, engine can use real reflection map to get specular normal (see r_shadow_glossexact below)&lt;/font&gt;
 SpecularNormal = PixelNormal + EyeVector;
 Specular = SpecularColor * power(dotproduct(PixelNormal, SpecularNormal), SpecularExponent)
{{important|Forced gloss (gloss 2) which is used if texture's gloss map is missed, are only used on outside map to simulate wet surfaces effect.}}

{{cvar|r_shadow_glossintensity|Global intensity for specular calculations, default is 1.}}
{{cvar|r_shadow_gloss2intensity|Global intensity for specular calculations applied for forced-gloss surfaces, default is 1.}}
{{cvar|r_shadow_glossexponent|Global gloss exponent used as a base in shader calculations.}}
{{cvar|r_shadow_gloss2exponent|Same one used for forced-gloss surfaces.}}
{{cvar|r_shadow_glossexact|Use real reflection math for gloss calculation. This is slower and little more correct.}}

==Shadows==
Shadows are most valuable part of realtime lighting. They are increasing scene depth so it looks more realistic. 

{{important|Shadows are quite complex render task, many lights casting many shadows may decrease rendering speed significantly. Map designer should plan his map with this limitation in mind - there should be no situation of many lights being seen from a certain point, or user will experience a game slowdown.}}

Darkplaces supports two realtime shadowing techniques: stencil shadow volumes and shadow mapping.

===Stencil shadow volumes===
[http://en.wikipedia.org/wiki/Shadow_volume Stencil shadow volumes] is a base shadow rendering method in Darkplaces. 

This technique is well known for it's shadows not having penumbra. Many other restrictions (high fillrate hit, bad scalability) make this method to be used only on a few games (such as Doom 3).

{{cvar|r_shadow_polygonfactor|how much to enlarge shadow volume polygons when rendering (should be 0!)}}
{{cvar|r_shadow_polygonoffset|how much to push shadow volumes into the distance when rendering, to reduce chances of zfighting artifacts (should not be less than 0)}}
{{cvar|r_shadow_frontsidecasting|whether to cast shadows from illuminated triangles (front side of model) or unlit triangles (back side of model)}}
{{cvar|r_showshadows|Show areas covered by shadow volumes. Useful for finding out why some areas of the map render slowly &lt;nowiki&gt;(bright blue = lots of passes, slow)&lt;/nowiki&gt;. Only matters if using shadow volumes.}}

===Shadow mapping===
In 2010 darkplaces got [http://en.wikipedia.org/wiki/Shadow_mapping shadow mapping] implemented by [http://sauerbraten.org/ Eihrul]. 

Shadowmapping have a number of advantages over shadow volume rendering and is considered to replace it:
* Penumbra
* Fast to render (especially on complex area maps)
* Takes less CPU time (as construction of shadow volumes is not required)
* Distance-based LOD (far lights rendered with lower shadowmap resolution)

{{hidden begin|Console variables}}
{{cvar|r_shadow_shadowmapping|Enables shadow mapping}}
{{cvar|r_shadow_shadowmapping|Shadowmap [[bias]] parameter (this is multiplied by nearclip * 1024 / lodsize}}
{{cvar|r_shadow_shadowmapping_bordersize|Shadowmap size bias for filtering}}
{{cvar|r_shadow_shadowmapping_depthbits|Requested minimum shadowmap texture depth bits, could be 16 or 24}}
{{cvar|r_shadow_shadowmapping_filterquality|Shadowmap filter modes&lt;nowiki&gt;: -1 = auto-select, 0 = no filtering, 1 = bilinear, 2 = bilinear 2x2 blur (fast), 3 = 3x3 blur (moderate), 4 = 4x4 blur (slow)&lt;/nowiki&gt;}}
{{cvar|r_shadow_shadowmapping_maxsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_minsize|Shadowmap size limit}}
{{cvar|r_shadow_shadowmapping_nearclip|Shadowmap near clip in world units. Increasing this will make shadow rendering to be more precise (as more bits goes to middle range), at the cost of the small non-shadowed zone around light}}
{{cvar|r_shadow_shadowmapping_polygonfactor|Slope-dependent shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_polygonoffset|Constant shadow mapping bias}}
{{cvar|r_shadow_shadowmapping_precision|Makes shadowmaps have a maximum resolution of this number of pixels per light source radius unit such that, for example, at precision 0.5 a light with radius 200 will have a maximum resolution of 100 pixels}}
{{cvar|r_shadow_shadowmapping_useshadowsampler|whether to use sampler2DShadow if available}}
{{cvar|r_shadow_shadowmapping_vsdct|enables use of virtual shadow depth cube texture}}
{{cvar|r_usedepthtextures|Use depth texture instead of depth renderbuffer where possible, uses less video memory but may render slower (or faster) depending on hardwaree.}}
{{bug|r_usedepthtextures causing strong precision drop, which leads to splotches around shadow edges}}
{{hidden end}}

==Other light models==
Darkplaces includes other lighting models which are used eventually:

'''Fake light'''
:A developer-only mode which is forced on non-lit maps (ones which was compiled and didnt get LIGHT phase). This is infinite realtime light that is cast from eye position.
'''Sun light'''
:A similar to fake light technique to render sun lighting on outdoor surfaces, Used for sunset and sun dawn effects on outdoor maps.
'''Cel shading'''
:Altered shading for default lighting model.
:{{cvar|r_celshading|Enable cel shading (alternate diffuse math)}}
'''Lightmap'''
:Lightmap with no deluxemap applied (just an old lightmap with no per-pixel lighting effects)
'''Fullbright'''
:No lighting applied (all textures at their full brightness)

{{navigation footer|Special effects}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces lighting/Special effects</title>
    <ns>0</ns>
    <id>235</id>
      <sha1>8ryqf071eyrn7j3lxc1adeo5yvhop7x</sha1>
    <revision>
      <id>2486</id>
      <timestamp>2012-08-05T21:03:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Lighting methods}} This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will he...&quot;</comment>
      <text xml:space="preserve" bytes="4083">{{navigation title|Lighting methods}}
This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will help to create wide range of things, such as:switchable lights, projective lights, sunlight simulation, flickering lights and more.

==Light styles==
Stub!

==Coronas==
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

==Cubemap filtering==
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

==Planar shadows==
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

{{tip|Planar shadows could be used to simulate sunlight in outdoor locations.}}

{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}

==Customized ModelLight==
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client-side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

==Fog==
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following options:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

{{navigation footer|Light sources}}</text>
    </revision>
    <revision>
      <id>2500</id>
      <timestamp>2012-08-08T13:58:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4081">{{navigation title|Lighting model}}
This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will help to create wide range of things, such as:switchable lights, projective lights, sunlight simulation, flickering lights and more.

==Light styles==
Stub!

==Coronas==
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

==Cubemap filtering==
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

==Planar shadows==
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

{{tip|Planar shadows could be used to simulate sunlight in outdoor locations.}}

{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}

==Customized ModelLight==
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client-side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

==Fog==
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following options:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

{{navigation footer|Light sources}}</text>
    </revision>
    <revision>
      <id>2740</id>
      <timestamp>2012-10-07T11:12:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="4096">{{navigation title|Lighting model}}
{{unfinished}}
This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will help to create wide range of things, such as:switchable lights, projective lights, sunlight simulation, flickering lights and more.

==Light styles==
Stub!

==Coronas==
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

==Cubemap filtering==
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

==Planar shadows==
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

{{tip|Planar shadows could be used to simulate sunlight in outdoor locations.}}

{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}

==Customized ModelLight==
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client-side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

==Fog==
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following options:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

{{navigation footer|Light sources}}</text>
    </revision>
    <revision>
      <id>2741</id>
      <timestamp>2012-10-07T11:14:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Planar shadows */</comment>
      <text xml:space="preserve" bytes="4091">{{navigation title|Lighting model}}
{{unfinished}}
This chapter contains reference of various special effects hardcoded in light renderer. This special effects, applied or combined will help to create wide range of things, such as:switchable lights, projective lights, sunlight simulation, flickering lights and more.

==Light styles==
Stub!

==Coronas==
Coronas aimed to simulate glow around dynamic lights, which looks good on small and medium size lights. Coronas are customised per-light (size and brightness) an also can be placed without lights.
{{cvar|r_coronas|Brightness of corona effects. 0 disables coronas.}}
{{cvar|r_coronas_occlusionquery|Fades coronas according to visibility. Bad perormance (synchoronus rendering), even worse on multi-GPU.}}
{{cvar|r_coronas_occlusionquerysize|Size of lightsource for corona occlusion checksum. Usial value is 0.1}}

==Cubemap filtering==
A technique for modeling non-uniform light distribution according to direction, for example a lantern may use a cubemap to describe the light emission pattern of the cage around the lantern (as well as soot buildup discoloring the light in certain areas), often also used for softened grate shadows and light shining through a stained glass window (done crudely by texturing the lighting with a cubemap), another good example would be a discolight.

Any dynamic lightsource can have cubemap attached.

==Planar shadows==
Simplified global shadows which are cast from entities, not from lights (so planar shadows are just filters, they dont do any lighting math). 

Planar shadows are either stencil or shadowmapped if shadowmapping is on.

{{tip|Planar shadows are used to simulate sunlight in outdoor locations.}}

{{cvar|r_shadows|Enable planar shadows cast using [[lightgrid]]-stored light direction. When set to 2 always cast the shadows in the certain direction (see below). Shadowmapping only supports r_shadows 2.}}
{{cvar|r_shadows_castfrombmodel|Enables shadows cast from [[BModel | bmodels]].}}
{{cvar|r_shadows_darken|How much shadowed areas will be darkened.}}
{{cvar|r_shadows_drawafterrtlighting|Hack to draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating sunlight on large outdoor maps with only one big noshadow rtlight. The price is less realistic appearance of dynamic light shadows.}}
{{cvar|r_shadows_focus|Offset the shadowed area focus (used for shadowed area bounds).}}
{{cvar|r_shadows_shadowmapscale|Increases shadowmap quality (multiply global shadowmap precision). Needs shadowmapping ON.}}
{{cvar|r_shadows_throwdirection|r_shadows 2 throwing direction. Default is '0 0 -1' (down).}}
{{cvar|r_shadows_throwdistance|How far to cast shadows from models. This sets shadowed area bounds for shadowmapping.}}

==Customized ModelLight==
Lightgrid sampling (diffuse, ambient and light vector components) can be overriden by Client-side QuakeC. Allows various lighting effects on models (strobing, using different positions for sampling etc.)

==Fog==
Fog are global. Optionally, height plane and height texture can be defined which will make fog to fade with height.

Fog have the following options:

* density - how much fog to add per distance, this is virtual value. 1 means very strong fog.
* red - red component of fog color
* green - green component of fog color
* blue - blue component of fog color
* alpha - fog effect opacity (default is 1)
* mindist - distance to start applying fog at
* maxdist - maximal distance apply fog at
* top - origin of height plane at worldspace (game units)
* height - fog height fade in game units
* fadetexture - horizontal texture that resembles fading, left pixel if top bright, right is top dark. Can be used for non-linear fading.

Fog are set by console commands:
{{cmd|fog &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; [&lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt;]&lt;/nowiki&gt;|Sets the global fog}}
{{cmd|fog_heighttexture &lt;nowiki&gt;&lt;density&gt; &lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;alpha&gt; &lt;mindist&gt; &lt;maxdist&gt; &lt;top&gt; &lt;height&gt; &lt;fadetexture&gt;&lt;/nowiki&gt;|Sets the global fog with customized fade texture}}

{{navigation footer|Light sources}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces material system</title>
    <ns>0</ns>
    <id>122</id>
      <sha1>p23kr1r6t1fgzrajuu4qgqnyn2fvm9p</sha1>
    <revision>
      <id>1274</id>
      <timestamp>2012-07-20T06:13:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Introduction == Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This artic...&quot;</comment>
      <text xml:space="preserve" bytes="1954">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, Shader scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the Q3MAP keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map path/to/texture
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.</text>
    </revision>
    <revision>
      <id>1275</id>
      <timestamp>2012-07-20T07:02:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3016">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the Q3MAP keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map path/to/texture
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

=== Material names &amp; conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; shader parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.</text>
    </revision>
    <revision>
      <id>1276</id>
      <timestamp>2012-07-20T07:05:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3095">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the Q3MAP keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; shader parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.</text>
    </revision>
    <revision>
      <id>1277</id>
      <timestamp>2012-07-20T07:05:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3102">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the Q3MAP keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; shader parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.</text>
    </revision>
    <revision>
      <id>1278</id>
      <timestamp>2012-07-20T07:06:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3114">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; shader parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.</text>
    </revision>
    <revision>
      <id>1279</id>
      <timestamp>2012-07-20T07:07:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3114">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; shader parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.</text>
    </revision>
    <revision>
      <id>1280</id>
      <timestamp>2012-07-20T07:16:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4640">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 shaders system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Quake 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical:
* Material = Shader
* Material name = Shader name = Surface shader = Surface material
* Material script = Shader script

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Shader keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1281</id>
      <timestamp>2012-07-20T07:52:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10155">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a Scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''Texture units'''
:This is the normalized (see above) dimensions of the original texture image (or a previously modified texture at a given stage in the material pipeline). A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.</text>
    </revision>
    <revision>
      <id>1289</id>
      <timestamp>2012-07-20T08:11:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10165">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a Scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image (or a previously modified texture at a given stage in the material pipeline). A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.</text>
    </revision>
    <revision>
      <id>1290</id>
      <timestamp>2012-07-20T08:12:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Measurements */</comment>
      <text xml:space="preserve" bytes="10088">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a Scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.</text>
    </revision>
    <revision>
      <id>1291</id>
      <timestamp>2012-07-20T08:17:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="10088">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.</text>
    </revision>
    <revision>
      <id>1296</id>
      <timestamp>2012-07-20T09:20:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="12749">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1297</id>
      <timestamp>2012-07-20T09:20:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="12749">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

*== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1298</id>
      <timestamp>2012-07-20T09:20:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="12749">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

--- Material names &amp; Conventions ---
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1299</id>
      <timestamp>2012-07-20T09:20:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="12753">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== 2.1 Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1300</id>
      <timestamp>2012-07-20T09:21:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="12749">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1301</id>
      <timestamp>2012-07-20T09:36:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15206">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes wave &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt; ====
Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; ====
This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1302</id>
      <timestamp>2012-07-20T09:37:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15207">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

:''' deformVertexes wave &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt; '''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

:''' deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1303</id>
      <timestamp>2012-07-20T09:37:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15204">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

:'''deformVertexes wave &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

:'''deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1304</id>
      <timestamp>2012-07-20T09:38:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15203">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes wave &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1305</id>
      <timestamp>2012-07-20T09:38:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15191">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes wave div func base amplitude phase freq'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1306</id>
      <timestamp>2012-07-20T09:39:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15195">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes wave&amp;rt; div func base amplitude phase freq'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1307</id>
      <timestamp>2012-07-20T09:39:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15195">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes wave&amp;gt; div func base amplitude phase freq'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1308</id>
      <timestamp>2012-07-20T09:40:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15222">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1309</id>
      <timestamp>2012-07-20T09:40:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15239">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore there is some serious differences because Darkplaces material system was written independently and aimed to realtime lightning rendering and OpenGL 2.0.

Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.</text>
    </revision>
    <revision>
      <id>1310</id>
      <timestamp>2012-07-20T09:54:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18590">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''Aiming at OpenGL 2.0+'''
:Using FBO, VBO to speed up things. This changes the speed affection of some effects (like deformVertexes cost more speed in Darkplaces that in Q3, since forces surface3 to not use VBO).

'''No render passes'''
:Material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Unlit texture with terrain blending: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other stage configuration such as q3 skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface withing a model layers with different material (for map surfaces can use Q3map2's q3map_cloneShader)

'''Slightly different behavior compared to IdTech 3'''
:Some keywords behave differently.

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1311</id>
      <timestamp>2012-07-20T09:55:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Inspired by Quake 3 but different */</comment>
      <text xml:space="preserve" bytes="18594">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with materials. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''Aiming at OpenGL 2.0+'''
:Using FBO, VBO to speed up things. This changes the speed affection of some effects (like deformVertexes cost more speed in Darkplaces that in Q3, because it forces surface to not use VBO).

'''No render passes'''
:Material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Unlit texture with terrain blending: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other stage configuration such as q3 skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface withing a model layers with different material (for map surfaces can use Q3map2's q3map_cloneShader)

'''Slightly different behavior compared to IdTech 3'''
:Some keywords behave differently.

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1312</id>
      <timestamp>2012-07-20T10:39:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Inspired by Quake 3 but different */</comment>
      <text xml:space="preserve" bytes="19379">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping may increased amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulenT, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1313</id>
      <timestamp>2012-07-20T10:39:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19390">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping may increased amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulenT, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1314</id>
      <timestamp>2012-07-20T10:42:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19385">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keyworkds
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1315</id>
      <timestamp>2012-07-20T10:42:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19384">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

=== Key Concepts ===

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

==== Surface Effects vs. Content Effects vs. Deformation Effects ====
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

==== Power Has a Price ====
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

==== RGB Color ====
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

==== Normalization: a scale of 0 to 1 ====
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

==== Texture Sizes ====
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

==== Measurements ====
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

==== Waveform Functions ====

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1316</id>
      <timestamp>2012-07-20T10:47:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19368">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1317</id>
      <timestamp>2012-07-20T10:48:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Material system2]] to [[Darkplaces Material System]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="19368">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1319</id>
      <timestamp>2012-07-20T10:49:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Darkplaces Material System]] to [[Darkplaces material system]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="19368">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 textures/mymaterial
 {
    // parameters
    qer_editorImage radiant/textures/mymaterial
    q3map_textureImage radiant/textures/mymaterial
    dpglossexponentmod 0.5
    surfaceparm stone
    // base stage
    {
        map textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg
    }
    // lighting stage
    {
        map $lightmap
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1334</id>
      <timestamp>2012-07-20T11:04:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19628">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 // material definition
 '''textures/mymaterial'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=orange&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=orange&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1335</id>
      <timestamp>2012-07-20T11:04:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19649">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/mymaterial'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; textures/mymaterial // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1336</id>
      <timestamp>2012-07-20T11:04:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19655">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/mymaterial'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/mymaterial''' // engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1337</id>
      <timestamp>2012-07-20T11:05:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19673">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/mymaterial'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/mymaterial'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/mymaterial''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1338</id>
      <timestamp>2012-07-20T11:05:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19677">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1339</id>
      <timestamp>2012-07-20T11:06:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19675">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=red&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=red&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1340</id>
      <timestamp>2012-07-20T11:06:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19681">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=orange&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=orange&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1341</id>
      <timestamp>2012-07-20T11:06:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19687">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=lightblue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=lightblue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1342</id>
      <timestamp>2012-07-20T11:06:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="19677">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt;&lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
This forces a bulge to move along the given s and t directions. Designed for use on curved pipes.

Specific parameter definitions for deform keywords:
&lt;div&gt; This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

&lt;func&gt; This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

&lt;base&gt; This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

&lt;amplitude&gt; The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

&lt;phase&gt; See Wave Forms in the introduction for a description of phase)

&lt;frequency&gt; See Wave Forms in the introduction for a description of frequency)

Design Note: The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1343</id>
      <timestamp>2012-07-20T11:18:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19734">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''Specific parameter definitions for deform keywords''':

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The '''div''' and '''amplitude''' parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1344</id>
      <timestamp>2012-07-20T11:19:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="19749">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''Specific parameter definitions for deform keywords''':

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The '''div''' and '''amplitude''' parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1345</id>
      <timestamp>2012-07-20T11:19:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes */</comment>
      <text xml:space="preserve" bytes="19753">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; '''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The '''div''' and '''amplitude''' parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1346</id>
      <timestamp>2012-07-20T11:22:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes */</comment>
      <text xml:space="preserve" bytes="20709">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:Design Note: If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The '''div''' and '''amplitude''' parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1347</id>
      <timestamp>2012-07-20T11:23:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes normal      */</comment>
      <text xml:space="preserve" bytes="20716">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

''''Game unit''''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The '''div''' and '''amplitude''' parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1348</id>
      <timestamp>2012-07-20T11:23:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Measurements */</comment>
      <text xml:space="preserve" bytes="20714">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The '''div''' and '''amplitude''' parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1349</id>
      <timestamp>2012-07-20T11:23:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Specific parameter definitions for deform keywords: */</comment>
      <text xml:space="preserve" bytes="20740">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1350</id>
      <timestamp>2012-07-20T11:25:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes */</comment>
      <text xml:space="preserve" bytes="21451">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''DeformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.

:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1351</id>
      <timestamp>2012-07-20T11:28:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="21686">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''DeformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''DeformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

==== Specific parameter definitions for deform keywords: ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1352</id>
      <timestamp>2012-07-20T11:29:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes */</comment>
      <text xml:space="preserve" bytes="21704">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

==== Specific parameter definitions for deform keywords ====

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1353</id>
      <timestamp>2012-07-20T12:26:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="21700">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1354</id>
      <timestamp>2012-07-20T12:37:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="22665">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

==== q3map_globaltexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.</text>
    </revision>
    <revision>
      <id>1355</id>
      <timestamp>2012-07-20T12:51:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Q3Map2 Specific Keywords */</comment>
      <text xml:space="preserve" bytes="26589">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1356</id>
      <timestamp>2012-07-20T13:18:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>3</comment>
      <text xml:space="preserve" bytes="31369">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ====

This is, by the fact, most widely used and most messy material keyword. It sets various surface flags, some used by engine, some by Q3Map2. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''.

==== lava, water, slime ====
Assigns to the texture the game properties set for water, lava or slime. This affects both the surface and the content of a brush.

==== nonsolid ====
This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ===
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.




=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1357</id>
      <timestamp>2012-07-20T13:18:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="31369">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are nearly identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most messy material keyword. It sets various surface flags, some used by engine, some by Q3Map2. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''.

==== lava, water, slime ====
Assigns to the texture the game properties set for water, lava or slime. This affects both the surface and the content of a brush.

==== nonsolid ====
This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.




=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1358</id>
      <timestamp>2012-07-20T18:16:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="31362">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most messy material keyword. It sets various surface flags, some used by engine, some by Q3Map2. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''.

==== lava, water, slime ====
Assigns to the texture the game properties set for water, lava or slime. This affects both the surface and the content of a brush.

==== nonsolid ====
This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.




=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1359</id>
      <timestamp>2012-07-22T14:42:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="31363">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most messy material keyword. It sets various surface flags, some used by engine, some by Q3Map2. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''.

==== lava, water, slime ====
Assigns to the texture the game properties set for water, lava or slime. This affects both the surface and the content of a brush.

==== nonsolid ====
This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.




=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1361</id>
      <timestamp>2012-07-22T16:00:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="31830">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. 

It sets various surface flags, some used by engine, some by Q3Map2, some are used by the engine. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

{| style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| Yes
| Yes
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.
|}
|-
| water
| Yes
| Yes
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| Yes
| Yes
| Assigns to the texture the game properties set for lava.
|-
| slime
| Yes
| Yes
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1362</id>
      <timestamp>2012-07-22T16:01:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="31827">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. 

It sets various surface flags, some used by engine, some by Q3Map2, some are used by the engine. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

{| style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| Yes
| Yes
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.
|-
| water
| Yes
| Yes
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| Yes
| Yes
| Assigns to the texture the game properties set for lava.
|-
| slime
| Yes
| Yes
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1363</id>
      <timestamp>2012-07-22T16:03:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="31864">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. 

It sets various surface flags, some used by engine, some by Q3Map2, some are used by the engine. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| Yes
| Yes
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.
|-
| water
| Yes
| Yes
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| Yes
| Yes
| Assigns to the texture the game properties set for lava.
|-
| slime
| Yes
| Yes
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1369</id>
      <timestamp>2012-07-22T16:20:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="31872">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture units.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. 

It sets various surface flags, some used by engine, some by Q3Map2, some are used by the engine. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| [[BIH]]
| [[BSP]]
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.
|-
| water
| BIH
| BSP
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| BIH
| BSP
| Assigns to the texture the game properties set for lava.
|-
| slime
| BIH
| BSP
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1370</id>
      <timestamp>2012-07-22T16:21:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Measurements */</comment>
      <text xml:space="preserve" bytes="31878">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. 

It sets various surface flags, some used by engine, some by Q3Map2, some are used by the engine. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| [[BIH]]
| [[BSP]]
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.
|-
| water
| BIH
| BSP
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| BIH
| BSP
| Assigns to the texture the game properties set for lava.
|-
| slime
| BIH
| BSP
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1371</id>
      <timestamp>2012-07-22T16:25:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="32024">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

It sets various surface flags, some used by engine, some by Q3Map2, some are used by the engine. All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| [[BIH]]
| [[BSP]]
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.
|-
| water
| BIH
| BSP
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| BIH
| BSP
| Assigns to the texture the game properties set for lava.
|-
| slime
| BIH
| BSP
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp. 
|-
| nodraw
| No
| Yes
| Obsolete. Uas used to disable drawing of surface. In Darkp
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1372</id>
      <timestamp>2012-07-22T16:35:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="32228">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolit''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine.

Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| [[BIH]]
| [[BSP]]
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush. This stll make q3map2 generate collision surfaces.
|-
| water
| BIH
| BSP
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| BIH
| BSP
| Assigns to the texture the game properties set for lava.
|-
| slime
| BIH
| BSP
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp. 
|-
| nodraw
| No
| Yes
| This keyword make Q3map2 to not generate any drawsurfaces for this material.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1373</id>
      <timestamp>2012-07-22T16:35:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="32227">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse;&quot;
! Keyword 
! Engine
! Q3map2
! Description
|-
| nonsolid
| [[BIH]]
| [[BSP]]
| This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush. This stll make q3map2 generate collision surfaces.
|-
| water
| BIH
| BSP
| Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
|-
| lava
| BIH
| BSP
| Assigns to the texture the game properties set for lava.
|-
| slime
| BIH
| BSP
| Assigns to the texture the game properties set for slime. In Blood Omnicide, slime is swamp. 
|-
| nodraw
| No
| Yes
| This keyword make Q3map2 to not generate any drawsurfaces for this material.
|}

==== nonsolid ====

==== nodraw ====
This flags is not supported by Darkplaces, instead dont define any stages in material and it will be not drawn.

==== nomarks ====
Prevents engine from spawning decals for this surface.

==== alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the q3map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Design Note''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.

4.8.10 nodlight
Read as &quot;No Dee Light&quot;. A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. And example in Quake III Arena would be solid lava.

4.8.11 nodraw
A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, and so on.

4.8.12 nodrop
When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for &quot;Pits of Death.&quot; Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits.

4.8.13 noimpact
World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.

4.8.14 nomarks
Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.

Design Note: Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

4.8.15 nolightmap
This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.

4.8.18 origin
Used on the &quot;origin&quot; texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.

4.8.19 playerclip
Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.

4.8.20 slick
This surfaceparm included in a texture should give it significantly reduced friction.

4.8.21 slime
Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.

4.8.22 structural
This surface attribute causes a brush to be seen by the Q3MAP process as a possible break-point in a BSP tree. It is used as a part of the shader for the &quot;hint&quot; texture. Generally speaking, any opaque texture not marked as &quot;detail&quot; is by default, structural, so you shouldn't need to specify this.

4.8.23 trans
Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

4.8.24 water
Assigns to the texture the game properties for water.

==== flesh ====
This flag are not used in Darkplaces engine. But it is accessible with QuakeC so mod authors can use it. Blood Omnicide is using a number assigned to that flag for physics materials system (it is using 5 flags = flesh, metalsteps, nosteps, nodamage, slick to form a 32 different physical materials for hit effects and footstep sound)

==== metalsteps, nosteps, nodamage ====
Not used in Darkplaces. Assessible with QuakeC.

==== fog ====
Not used in Darkplaces as fog brushes is not supported. Maybe someday that support will be added.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1374</id>
      <timestamp>2012-07-22T17:07:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="28625">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm &lt;nowiki&gt;&lt;parm&gt;&lt;/nowiki&gt; ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1375</id>
      <timestamp>2012-07-22T17:07:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm  */</comment>
      <text xml:space="preserve" bytes="28601">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

'''IMPORTANT NOTE''': Once again, be aware that some of the shader commands may be order dependent, so it's good practice to place all global shader commands (keywords defined in this section) at the very beginning of the shader and to place shader stages at the end.

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1376</id>
      <timestamp>2012-07-22T17:08:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="28332">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_'''surfaceparmname'''''' keyword which make surfaceparm that is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1377</id>
      <timestamp>2012-07-22T17:09:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="28330">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponting '''q3map_''surfaceparmname''''' keyword which make surfaceparm that is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1378</id>
      <timestamp>2012-07-22T17:10:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="28357">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1379</id>
      <timestamp>2012-07-22T17:11:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="28356">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is completely ignored by the engine. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1390</id>
      <timestamp>2012-07-22T17:30:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="28347">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must recompile the [[Map | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1391</id>
      <timestamp>2012-07-22T17:31:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Types */</comment>
      <text xml:space="preserve" bytes="28348">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine (server &amp; client [[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1392</id>
      <timestamp>2012-07-22T17:54:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm nonsolid */</comment>
      <text xml:space="preserve" bytes="28332">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (server &amp; client collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime is swamp.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': engine (server &amp; client BIH collision), q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1393</id>
      <timestamp>2012-07-22T17:56:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="28255">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime defines a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1394</id>
      <timestamp>2012-07-22T17:57:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="28289">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime defines a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1395</id>
      <timestamp>2012-07-22T18:06:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="29533">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm detail ====

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime defines a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1397</id>
      <timestamp>2012-07-22T18:18:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="29955">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (visibility phase)
:'''Design Notes''': This world is used on common/hint [[common materials | material]]. You dont need to specity it on your new materials.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime defines a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1398</id>
      <timestamp>2012-07-22T18:19:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="29948">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This world is used on common/hint [[common materials | material]]. You dont need to specity it on your new materials.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm water ====
Assigns to the texture the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm slime ====
Same as for water, but generating contents and surfaceflags of slime.  In Blood Omnicide, slime defines a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm nodraw====
Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1401</id>
      <timestamp>2012-07-22T18:58:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="32650">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on common/hint [[common materials | material]]. You dont need to specify it on your new materials.

==== surfaceparm lava ====
Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on common/lightgrid material. You dont need to specify it on your new materials.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on common/monsterclip material. You dont need to specify it on your new materials.

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/origin material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on common/playerclip material. You dont need to specify it on your new materials.

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1402</id>
      <timestamp>2012-07-22T18:59:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm lava */</comment>
      <text xml:space="preserve" bytes="32650">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on common/hint [[common materials | material]]. You dont need to specify it on your new materials.

==== surfaceparm lava ====
:Same as for water, but generating contents and surfaceflags of lava.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on common/lightgrid material. You dont need to specify it on your new materials.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on common/monsterclip material. You dont need to specify it on your new materials.

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/origin material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on common/playerclip material. You dont need to specify it on your new materials.

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1403</id>
      <timestamp>2012-07-22T18:59:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm lava */</comment>
      <text xml:space="preserve" bytes="32675">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on common/hint [[common materials | material]]. You dont need to specify it on your new materials.

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on common/lightgrid material. You dont need to specify it on your new materials.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on common/monsterclip material. You dont need to specify it on your new materials.

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/origin material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on common/playerclip material. You dont need to specify it on your new materials.

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1404</id>
      <timestamp>2012-07-22T19:08:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="32956">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword. Many of these keywords are only used in [[common materials]].

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1405</id>
      <timestamp>2012-07-22T19:08:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="32894">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map2_nonsolid''', '''q3map2_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1406</id>
      <timestamp>2012-07-22T19:09:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="32892">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1407</id>
      <timestamp>2012-07-22T19:09:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm alphashadow */</comment>
      <text xml:space="preserve" bytes="32898">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1416</id>
      <timestamp>2012-07-22T19:27:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm water */</comment>
      <text xml:space="preserve" bytes="32899">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

==== surfaceparm hint ====
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

==== surfaceparm monsterclip ====
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

==== surfaceparm lightgrid ====
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

==== surfaceparm playerclip ====
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

==== surfaceparm origin ====
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

==== surfaceparm structural ====
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1417</id>
      <timestamp>2012-07-22T19:36:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="32887">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

''' surfaceparm hint '''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

''' surfaceparm monsterclip '''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

''' surfaceparm lightgrid '''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

''' surfaceparm playerclip '''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

''' surfaceparm origin '''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

''' surfaceparm structural '''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1418</id>
      <timestamp>2012-07-22T19:37:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="33007">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
This is system surfaceparms that is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;1&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;1&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;1&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;1&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;1&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;1&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1419</id>
      <timestamp>2012-07-22T19:38:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="33025">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;3&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;3&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;3&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;3&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;3&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;3&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1420</id>
      <timestamp>2012-07-22T19:38:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="33025">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1421</id>
      <timestamp>2012-07-22T19:39:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="33037">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

{{hidden begin | System surfaceparms that is only used on common materials}}
==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1422</id>
      <timestamp>2012-07-22T19:40:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="33004">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

{{hidden begin | System surfaceparms list}}
'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase). 
{{hidden end}}

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1423</id>
      <timestamp>2012-07-22T19:40:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* System surfaceparms */</comment>
      <text xml:space="preserve" bytes="32944">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for verices and being saved to their rgba attributes). When engine found no lightmaps for a surface, will force it ti be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase).

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1424</id>
      <timestamp>2012-07-22T19:41:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm nolightmap */</comment>
      <text xml:space="preserve" bytes="32912">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word '''surfaceparm''' as follows: '''surfaceparm nonsolid''' or '''surfaceparm trans'''. Each surfaceparm have corresponding '''q3map_''surfaceparmname''''' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase).

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1425</id>
      <timestamp>2012-07-22T19:42:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="32900">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:'''Used by''': Q3map2 (BSP phase)

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:'''Used by''': Q3map2 (light phase)

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:'''Used by''': q3map2 (bsp phase).

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:'''Used by''': engine (renderer)
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:'''Used by''': engine ([[BIH]] collision), q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:'''Used by''': engine (BIH collision), q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:'''Used by''': Q3map2 (BSP phase)
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:'''Used by''': Q3map2 (light phase)
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:'''Used by''': engine (collision)
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:'''Used by''': q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:'''Used by''': q3map2 (bsp phase).

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Note''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Note''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Note''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1426</id>
      <timestamp>2012-07-22T19:46:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="32782">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase.
:'''Design Notes''': This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision).
:'''Design Notes''': This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision).
:'''Design Notes''': This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. 
:'''Design Notes''': This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1427</id>
      <timestamp>2012-07-22T19:47:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* System surfaceparms */</comment>
      <text xml:space="preserve" bytes="32676">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1428</id>
      <timestamp>2012-07-22T19:52:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Shader Keywords */</comment>
      <text xml:space="preserve" bytes="33170">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== surfaceparm alphashadow ====
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

==== surfaceparm detail ====
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

==== surfaceparm lava ====
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

==== surfaceparm lightfilter ====
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

==== surfaceparm nodraw ====
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

==== surfaceparm nomarks ====
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

==== surfaceparm nolightmap ====
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

==== surfaceparm nonsolid ====
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

==== surfaceparm slime ====
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

==== surfaceparm trans ====
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

==== surfaceparm water ====
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm hint&lt;/font&gt;'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm monsterclip&lt;/font&gt;'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm lightgrid&lt;/font&gt;'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm playerclip&lt;/font&gt;'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm origin&lt;/font&gt;'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''&lt;font size=&quot;2.5&quot;&gt;surfaceparm structural&lt;/font&gt;'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1432</id>
      <timestamp>2012-07-22T20:04:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* surfaceparm */</comment>
      <text xml:space="preserve" bytes="33014">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1433</id>
      <timestamp>2012-07-22T20:06:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="33061">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook and Q3Map2 Shader manual by Obsidian and ydnar adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1434</id>
      <timestamp>2012-07-22T20:07:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="33113">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of Quake 3 Shader Manual by By Paul Jaquays and Brian Hook and [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1435</id>
      <timestamp>2012-07-22T20:08:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="33186">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

This article will contain a parts of [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook and [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1436</id>
      <timestamp>2012-07-22T20:08:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="33165">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== Credits ===
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.</text>
    </revision>
    <revision>
      <id>1437</id>
      <timestamp>2012-07-22T20:09:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="33163">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1438</id>
      <timestamp>2012-07-22T20:30:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="34280">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Shader Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1439</id>
      <timestamp>2012-07-22T20:41:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="34273">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Shader Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1440</id>
      <timestamp>2012-07-22T20:41:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="34266">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1441</id>
      <timestamp>2012-07-22T20:45:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="34622">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

In Blood Omnicide, in order to get material scripts to be easily readed and edited, all material scripts should be formatted like this template:

 textures/mausoleum/outerwall3_1
 {
 :&amp;lt;Editor Specific Keywords&amp;gt;
 
 :&amp;lt;Q3Map2 Specific Keyworlds&amp;gt;
 :&amp;lt;General Keywords&amp;gt;
 :&amp;lt;Engine specific keywords&amp;gt;
 :{
 ::&amp;lt;Stage Keyworlds&amp;gt;
 :}
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1442</id>
      <timestamp>2012-07-22T20:45:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material names &amp; Conventions */</comment>
      <text xml:space="preserve" bytes="34622">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

In Blood Omnicide, in order to get material scripts to be easily readed and edited, all material scripts should be formatted like this template:

 textures/mausoleum/outerwall3_1
 {
  &amp;lt;Editor Specific Keywords&amp;gt;
 
  &amp;lt;Q3Map2 Specific Keyworlds&amp;gt;
  &amp;lt;General Keywords&amp;gt;
  &amp;lt;Engine specific keywords&amp;gt;
  {
   &amp;lt;Stage Keyworlds&amp;gt;
  }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1443</id>
      <timestamp>2012-07-22T20:46:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material names &amp; Conventions */</comment>
      <text xml:space="preserve" bytes="34647">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

In Blood Omnicide, in order to get material scripts to be easily readed and edited, all material scripts should be formatted like this template:

 textures/mausoleum/outerwall3_1
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keyworlds&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine specific keywords&amp;gt;
     {
          &amp;lt;Stage Keyworlds&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1444</id>
      <timestamp>2012-07-22T20:47:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material names &amp; Conventions */</comment>
      <text xml:space="preserve" bytes="34668">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material Scripts Formatting ====

In order to get materials to be easily readed and edited, it is recommended to format all material scripts like this template:

 textures/mausoleum/outerwall3_1
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keyworlds&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine specific keywords&amp;gt;
     {
          &amp;lt;Stage Keyworlds&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1445</id>
      <timestamp>2012-07-22T20:47:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Scripts Formatting */</comment>
      <text xml:space="preserve" bytes="34649">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material Scripts Formatting ====

In order to get materials to be easily readed and edited, it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keyworlds&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine specific keywords&amp;gt;
     {
          &amp;lt;Stage Keyworlds&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1446</id>
      <timestamp>2012-07-22T20:48:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Scripts Formatting */</comment>
      <text xml:space="preserve" bytes="34647">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material Scripts Formatting ====

In order to get materials to be easily readed and edited, it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1447</id>
      <timestamp>2012-07-22T20:49:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Scripts Formatting */</comment>
      <text xml:space="preserve" bytes="34647">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material Scripts Formatting ====

In order to get materials to be easily readed and edited, it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1448</id>
      <timestamp>2012-07-22T20:50:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Scripts Formatting */</comment>
      <text xml:space="preserve" bytes="34650">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material Scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1449</id>
      <timestamp>2012-07-22T20:51:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Scripts Formatting */</comment>
      <text xml:space="preserve" bytes="34650">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1450</id>
      <timestamp>2012-07-22T20:51:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Editor Specific Keywords */</comment>
      <text xml:space="preserve" bytes="34666">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1451</id>
      <timestamp>2012-07-22T20:55:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Editor Specific Keywords */</comment>
      <text xml:space="preserve" bytes="35273">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage textureName ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans N.N ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc func N.N ===

If material have alphaFunc, this keyword will make it to be rendered with alha test in level editor too. 

Functions are:

greater - greater than
gequal - greater or equal
lesser - lesser than
lequal - lesser or equal
equal - equal

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1452</id>
      <timestamp>2012-07-22T20:56:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Editor Specific Keywords */</comment>
      <text xml:space="preserve" bytes="35305">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alha test in level editor too. 

Functions are:

greater - greater than
gequal - greater or equal
lesser - lesser than
lequal - lesser or equal
equal - equal

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1453</id>
      <timestamp>2012-07-22T20:56:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; */</comment>
      <text xml:space="preserve" bytes="35315">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1454</id>
      <timestamp>2012-07-22T20:56:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; */</comment>
      <text xml:space="preserve" bytes="35316">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1455</id>
      <timestamp>2012-07-22T20:58:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* qer_editorImage &amp;lt;textureName&amp;gt; */</comment>
      <text xml:space="preserve" bytes="35508">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1456</id>
      <timestamp>2012-07-22T20:59:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* qer_editorImage &amp;lt;textureName&amp;gt; */</comment>
      <text xml:space="preserve" bytes="35509">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1457</id>
      <timestamp>2012-07-22T21:00:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="35540">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1458</id>
      <timestamp>2012-07-22T21:11:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Stage Specific Keywords */</comment>
      <text xml:space="preserve" bytes="37912">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information. The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
'''Example''':
  // a 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds. Each frame would be displayed for 1 second before the next one is displayed. The cycle repeats after the last frame in sequence shown.
 animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4 

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1459</id>
      <timestamp>2012-07-22T21:11:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* map &amp;lt;textureName&amp;gt; */</comment>
      <text xml:space="preserve" bytes="37913">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
'''Example''':
  // a 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds. Each frame would be displayed for 1 second before the next one is displayed. The cycle repeats after the last frame in sequence shown.
 animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4 

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1460</id>
      <timestamp>2012-07-22T21:11:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* clampMap &amp;lt;textureName&amp;gt; */</comment>
      <text xml:space="preserve" bytes="37918">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
'''Example''':
  // a 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds. Each frame would be displayed for 1 second before the next one is displayed. The cycle repeats after the last frame in sequence shown.
 animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4 

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1461</id>
      <timestamp>2012-07-22T21:12:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; */</comment>
      <text xml:space="preserve" bytes="37925">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
'''Example''':
 // A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.
 // Each frame would be displayed for 1 second before the next one is displayed.
 // The cycle repeats after the last frame in sequence shown.
 animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4 

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1462</id>
      <timestamp>2012-07-22T21:12:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; */</comment>
      <text xml:space="preserve" bytes="37930">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
'''Example''':
 // A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.
 // Each frame would be displayed for 1 second before the next one is displayed.
 // The cycle repeats after the last frame in sequence shown.
 '''animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1463</id>
      <timestamp>2012-07-22T21:15:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Map Specification */</comment>
      <text xml:space="preserve" bytes="38047">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
'''Example''':
 // A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.
 // Each frame would be displayed for 1 second before the next one is displayed.
 // The cycle repeats after the last frame in sequence shown.
 '''animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1464</id>
      <timestamp>2012-07-22T21:15:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; */</comment>
      <text xml:space="preserve" bytes="38048">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 // A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.
 // Each frame would be displayed for 1 second before the next one is displayed.
 // The cycle repeats after the last frame in sequence shown.
 '''animMap 0.25 models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1465</id>
      <timestamp>2012-07-22T21:16:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; */</comment>
      <text xml:space="preserve" bytes="38153">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;'''animMap'''&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1466</id>
      <timestamp>2012-07-22T21:16:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; */</comment>
      <text xml:space="preserve" bytes="38147">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1467</id>
      <timestamp>2012-07-22T21:24:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Stage Specific Keywords */</comment>
      <text xml:space="preserve" bytes="39114">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

* '''blend''' : Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').
* '''add''' : Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').
* '''addalpha''' : Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').
* '''filter''' : A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1468</id>
      <timestamp>2012-07-22T21:25:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* blendFunc &amp;lt;func&amp;gt; */</comment>
      <text xml:space="preserve" bytes="39145">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1469</id>
      <timestamp>2012-07-22T22:03:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* blendFunc &amp;lt;func&amp;gt; */</comment>
      <text xml:space="preserve" bytes="45065">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified. In otherwords, if you see:

 tcMod scale 0.5 0.5
 tcMod scroll 1 1

Then the texture coordinates will be scaled then scrolled.

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Currently undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcmod page&lt;/font &gt; 4 2 0.1

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1470</id>
      <timestamp>2012-07-22T22:04:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* tcMod &amp;lt;function&amp;gt; */</comment>
      <text xml:space="preserve" bytes="45120">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Currently undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcmod page&lt;/font &gt; 4 2 0.1

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1471</id>
      <timestamp>2012-07-22T22:05:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; */</comment>
      <text xml:space="preserve" bytes="45110">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcmod page&lt;/font &gt; 4 2 0.1

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1472</id>
      <timestamp>2012-07-22T22:05:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; */</comment>
      <text xml:space="preserve" bytes="45110">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1473</id>
      <timestamp>2012-07-22T22:09:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Stage Specific Keywords */</comment>
      <text xml:space="preserve" bytes="45186">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Base stage ===

=== Terrain blending stage ===

=== Lightmap stage ===

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1474</id>
      <timestamp>2012-07-22T22:16:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Stage Specific Keywords */</comment>
      <text xml:space="preserve" bytes="46253">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''

     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// background layer - grass&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc&lt;/font&gt; '''GL_SRC_ALPHA''' '''GL_ONE_MINUS_SRC_ALPHA'''
         &lt;font color=green&gt;// alphaFunc is optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc&lt;/font&gt; '''GE128''' 
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map $lightmap 
     }
 } 

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1475</id>
      <timestamp>2012-07-22T22:16:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending stage */</comment>
      <text xml:space="preserve" bytes="46253">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// background layer - grass&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc&lt;/font&gt; '''GL_SRC_ALPHA''' '''GL_ONE_MINUS_SRC_ALPHA'''
         &lt;font color=green&gt;// alphaFunc is optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc&lt;/font&gt; '''GE128''' 
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map $lightmap 
     }
 }

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1476</id>
      <timestamp>2012-07-22T22:16:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending stage */</comment>
      <text xml:space="preserve" bytes="46312">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     // terrain blending stage - foreground texture
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc&lt;/font&gt; '''GL_SRC_ALPHA''' '''GL_ONE_MINUS_SRC_ALPHA'''
         &lt;font color=green&gt;// alphaFunc is optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc&lt;/font&gt; '''GE128''' 
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map $lightmap 
     }
 }

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1477</id>
      <timestamp>2012-07-22T22:17:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending stage */</comment>
      <text xml:space="preserve" bytes="46337">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc&lt;/font&gt; '''GL_SRC_ALPHA''' '''GL_ONE_MINUS_SRC_ALPHA'''
         &lt;font color=green&gt;// alphaFunc is optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc&lt;/font&gt; '''GE128''' 
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map $lightmap 
     }
 }

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1478</id>
      <timestamp>2012-07-22T22:17:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending stage */</comment>
      <text xml:space="preserve" bytes="46315">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc&lt;/font&gt; '''GL_SRC_ALPHA''' '''GL_ONE_MINUS_SRC_ALPHA'''
         &lt;font color=blue&gt;alphaFunc&lt;/font&gt; '''GE128'''  &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map $lightmap 
     }
 }

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1479</id>
      <timestamp>2012-07-22T22:17:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending stage */</comment>
      <text xml:space="preserve" bytes="46266">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map $lightmap 
     }
 }

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1480</id>
      <timestamp>2012-07-22T22:18:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending stage */</comment>
      <text xml:space="preserve" bytes="46278">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Lightmap stage ===

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1481</id>
      <timestamp>2012-07-22T22:21:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap stage */</comment>
      <text xml:space="preserve" bytes="46977">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting (lightmap or lightgrid) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1482</id>
      <timestamp>2012-07-22T22:21:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap stage */</comment>
      <text xml:space="preserve" bytes="46985">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stage Specific Keywords ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1483</id>
      <timestamp>2012-07-22T22:22:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46968">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Texture Map Specification ===

==== map &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
* dds/texture/blah.dds
* texture/blah.tga
* texture/blah.png
* texture/blah.jpeg

==== map $lightmap ====
This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

==== clampMap &amp;lt;textureName&amp;gt; ====
Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

==== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ====
The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.

'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''

'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== blendFunc &amp;lt;func&amp;gt; ===

Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

==== Simplified Blend Functions ====

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1484</id>
      <timestamp>2012-07-22T22:24:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Stages */</comment>
      <text xml:space="preserve" bytes="46985">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map Specification ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

'''blendFunc &amp;lt;func&amp;gt;'''
:Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

===== Simplified Blend Functions =====
The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

==== Explicit Blend Functions ====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

==== tcMod rotate &amp;lt;degrees/sec&amp;gt; ====
This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

==== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ====
Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.

'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

==== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ====
Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.

'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5

'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

==== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ====
Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

==== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ====
Transforms each texture coordinate as follows:

S = s * m00 + t * m10 + t0

T = s * m01 + t * m11 + t1

This is for use by programmers.

==== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ====
Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.

'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

* '''base''' : Undefined.
* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
* '''phase''' : See the explanation for phase under the deformVertexes keyword.
* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

==== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ====
Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.

The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.

'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1485</id>
      <timestamp>2012-07-22T22:26:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Stages */</comment>
      <text xml:space="preserve" bytes="46979">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map Specification ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== blendFunc &amp;lt;func&amp;gt; ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

===== Simplified Blend Functions =====
The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

===== Explicit Blend Functions =====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1486</id>
      <timestamp>2012-07-22T22:27:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* blendFunc &amp;lt;func&amp;gt; */</comment>
      <text xml:space="preserve" bytes="46971">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map Specification ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== Blend Function ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

===== Simplified Blend Functions =====
The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

===== Explicit Blend Functions =====
Alternative, GL-friendly blending mode definition. Parameters are:

* GL_ONE
* GL_ZERO
* GL_SRC_COLOR
* GL_SRC_ALPHA
* GL_DST_COLOR
* GL_DST_ALPHA
* GL_ONE_MINUS_SRC_COLOR
* GL_ONE_MINUS_SRC_ALPHA
* GL_ONE_MINUS_DST_COLOR
* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1487</id>
      <timestamp>2012-07-22T22:27:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blend Function */</comment>
      <text xml:space="preserve" bytes="46936">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map Specification ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== Blend Function ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''Explicit Blend Functions'''
:Alternative, GL-friendly blending mode definition. Parameters are:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1488</id>
      <timestamp>2012-07-22T22:29:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blend Function */</comment>
      <text xml:space="preserve" bytes="47032">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map Specification ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== Blend Function ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc source destination'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1489</id>
      <timestamp>2012-07-22T22:29:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blend Function */</comment>
      <text xml:space="preserve" bytes="47048">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map Specification ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== Blend Function ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1490</id>
      <timestamp>2012-07-22T22:29:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Map Specification */</comment>
      <text xml:space="preserve" bytes="47034">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map ====

'''map &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. The texture may or may not contain alpha channel information.

:The texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''map $lightmap'''
:This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is only applicable in last lightmap stage.

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== Blend Function ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1491</id>
      <timestamp>2012-07-22T22:31:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Base stage */</comment>
      <text xml:space="preserve" bytes="46868">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Stages ==

=== Base stage ===

==== Texture Map ====
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

==== Blend Function ====
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

==== alphaGen vertex ====

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

==== tcGen environment ====
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

==== tcMod &amp;lt;function&amp;gt; ====
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

=== Lightmap stage ===

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

=== Terrain blending stage ===

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1492</id>
      <timestamp>2012-07-22T22:32:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46832">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

==== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

==== deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ====
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

==== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ====
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

==== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ====
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

==== DeformVertexes autosprite ====
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

==== DeformVertexes autosprite2 ====
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Base stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap stage ==

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1493</id>
      <timestamp>2012-07-22T22:34:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes */</comment>
      <text xml:space="preserve" bytes="46808">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

=== General use keywords ===

==== q3map_globalTexture ====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

==== q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt; ====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

=== q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt; ===
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

=== Lightmap keywords ===

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===

This keyword makes level editor to display different texture in 3D viewport.

The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.

Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].

'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)

'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===

This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===

If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 

Functions are:

* greater - greater than
* gequal - greater or equal
* lesser - lesser than
* lequal - lesser or equal
* equal - equal

== Base stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap stage ==

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1494</id>
      <timestamp>2012-07-22T22:36:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46798">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Specific Keywords ==

=== Q3Map2 specific keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 ==== Lightmap keywords ====

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap stage ==

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1495</id>
      <timestamp>2012-07-22T22:37:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46797">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 ==== Lightmap Keywords ====

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap stage ==

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1496</id>
      <timestamp>2012-07-22T22:37:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Base stage */</comment>
      <text xml:space="preserve" bytes="46797">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 ==== Lightmap Keywords ====

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap stage ==

Virtual stage that tells renderer to show material with static lighting ([[lightmap]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1497</id>
      <timestamp>2012-07-22T22:38:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap stage */</comment>
      <text xml:space="preserve" bytes="46810">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 ==== Lightmap Keywords ====

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1498</id>
      <timestamp>2012-07-22T22:38:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain blending */</comment>
      <text xml:space="preserve" bytes="46810">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &lt;nowiki&gt;&lt;shadername&gt;&lt;/nowiki&gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 ==== Lightmap Keywords ====

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1499</id>
      <timestamp>2012-07-22T22:41:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Q3Map2 Specific Keywords */</comment>
      <text xml:space="preserve" bytes="46798">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none'' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

==== Lightmap Keywords ====

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1500</id>
      <timestamp>2012-07-22T22:41:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Special Keywords */</comment>
      <text xml:space="preserve" bytes="46770">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

'''Aiming at realtime lightning'''
:Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

'''No render passes'''
:Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
:* No draw: 0 stages
:* Unlit texture: 1 stage
:* Lit texture: 2 stages
:* Lit texture with terrain blending: 3 stages
:All other Id Tech 3 stage configuration such as skies are not supported.

:'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

'''Many new keywords'''
:Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

'''Q3 Texture = Darkplaces skinframe'''
:Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

'''Different speed costs'''
:Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

'''Material is 'Shader''''
:Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1501</id>
      <timestamp>2012-07-22T22:55:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Inspired by Quake 3 but different */</comment>
      <text xml:space="preserve" bytes="46778">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Aiming at realtime lightning ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

==== No render passes ====
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

=== Surface Effects vs. Content Effects vs. Deformation Effects ===
Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1502</id>
      <timestamp>2012-07-22T22:56:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Key Concepts */</comment>
      <text xml:space="preserve" bytes="46710">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Aiming at realtime lightning ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

==== No render passes ====
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power Has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1503</id>
      <timestamp>2012-07-22T22:56:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Power Has a Price */</comment>
      <text xml:space="preserve" bytes="46710">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Aiming at realtime lightning ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

==== No render passes ====
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1504</id>
      <timestamp>2012-07-22T22:57:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Aiming at realtime lightning */</comment>
      <text xml:space="preserve" bytes="46700">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lightning ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

==== No render passes ====
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1505</id>
      <timestamp>2012-07-22T22:58:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Inspired by Quake 3 but different */</comment>
      <text xml:space="preserve" bytes="46734">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lightning ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

Aiming to realtime lightning changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one custom surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1506</id>
      <timestamp>2012-07-22T22:59:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Custom surfaceparms */</comment>
      <text xml:space="preserve" bytes="46740">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lightning ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

Aiming to realtime lightning changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1507</id>
      <timestamp>2012-07-22T23:00:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Realtime lightning */</comment>
      <text xml:space="preserve" bytes="46739">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lightning was removed. Other ones have sligtly changed behavior.

Aiming to realtime lightning changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lightning and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1508</id>
      <timestamp>2012-07-22T23:01:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46736">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.
Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.
Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.
Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1509</id>
      <timestamp>2012-07-22T23:01:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material names &amp; Conventions */</comment>
      <text xml:space="preserve" bytes="46739">== Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1510</id>
      <timestamp>2012-07-22T23:02:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46761">== Chapter 1: Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== Chapter 2: General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1511</id>
      <timestamp>2012-07-22T23:02:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Chapter 2: General Keywords */</comment>
      <text xml:space="preserve" bytes="46761">== Chapter 1: Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== Chapter 3: General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1512</id>
      <timestamp>2012-07-22T23:03:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Key Concepts */</comment>
      <text xml:space="preserve" bytes="46772">== Chapter 1: Introduction ==
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

== Chapter 2: Key Concepts ==

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

== Chapter 3: General Keywords ==

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

== Special Keywords ==

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1513</id>
      <timestamp>2012-07-22T23:04:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46741">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brusshes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1514</id>
      <timestamp>2012-07-22T23:05:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Q3Map2 Specific Keywords */</comment>
      <text xml:space="preserve" bytes="46740">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''':Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1515</id>
      <timestamp>2012-07-22T23:05:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Q3Map2 Specific Keywords */</comment>
      <text xml:space="preserve" bytes="46741">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none / cull disable ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1516</id>
      <timestamp>2012-07-22T23:07:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* cull none / cull disable */</comment>
      <text xml:space="preserve" bytes="46727">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1517</id>
      <timestamp>2012-07-22T23:08:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Terrain Blending */</comment>
      <text xml:space="preserve" bytes="46733">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the source texture map (a 24 or 32-bit TGA or JPEG file) used for this stage. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1518</id>
      <timestamp>2012-07-23T06:15:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Base Stage */</comment>
      <text xml:space="preserve" bytes="46734">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1519</id>
      <timestamp>2012-07-23T06:18:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46983">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| width=100%
| colspan=3 | Darkplaces material system
|-
| [[&amp;lt;&amp;lt;Darkplaces material system/Introduction | Introduction]]
| [[Darkplaces material system | Index]]
| [[&amp;gt;&amp;gt;Darkplaces material system/General Keywords | General Keywords]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1520</id>
      <timestamp>2012-07-23T06:18:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="47026">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| width=100% border=1 style=&quot;border-collapse: collapse&quot;
| colspan=4 | Darkplaces material system
|-
| [[&amp;lt;&amp;lt;Darkplaces material system/Introduction | Introduction]]
| [[Darkplaces material system | Index]]
| [[&amp;gt;&amp;gt;Darkplaces material system/General Keywords | General Keywords]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1521</id>
      <timestamp>2012-07-23T06:18:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="47026">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| width=100% border=1 style=&quot;border-collapse: collapse&quot;
! colspan=4 | Darkplaces material system
|-
| [[&amp;lt;&amp;lt;Darkplaces material system/Introduction | Introduction]]
| [[Darkplaces material system | Index]]
| [[&amp;gt;&amp;gt;Darkplaces material system/General Keywords | General Keywords]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1522</id>
      <timestamp>2012-07-23T06:19:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="47062">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| width=100% border=1 style=&quot;border-collapse: collapse&quot;
! colspan=4 | Darkplaces material system
|-
| width=33% | [[&amp;lt;&amp;lt;Darkplaces material system/Introduction | Introduction]]
| width=34% | [[Darkplaces material system | Index]]
| width=33% | [[&amp;gt;&amp;gt;Darkplaces material system/General Keywords | General Keywords]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1523</id>
      <timestamp>2012-07-23T06:19:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="47090">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| cellspacing=0 cellpadding=5 width=100% border=1 style=&quot;border-collapse: collapse&quot;
! colspan=4 | Darkplaces material system
|-
| width=33% | [[&amp;lt;&amp;lt;Darkplaces material system/Introduction | Introduction]]
| width=34% | [[Darkplaces material system | Index]]
| width=33% | [[&amp;gt;&amp;gt;Darkplaces material system/General Keywords | General Keywords]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1524</id>
      <timestamp>2012-07-23T06:19:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="47090">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| cellspacing=0 cellpadding=5 width=100% border=1 style=&quot;border-collapse: collapse&quot;
! colspan=4 | Darkplaces material system
|-
| width=33% | [[Darkplaces material system/Introduction | &amp;lt;&amp;lt;Introduction]]
| width=34% | [[Darkplaces material system | Index]]
| width=33% | [[Darkplaces material system/General Keywords | &amp;gt;&amp;gt;General Keywords]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1525</id>
      <timestamp>2012-07-23T06:20:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="47102">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| cellspacing=0 cellpadding=5 width=100% border=1 style=&quot;border-collapse: collapse&quot;
! colspan=4 | Darkplaces material system
|-
| width=33% | [[Darkplaces material system/Introduction | &amp;lt;&amp;lt;&amp;nbsp;Introduction]]
| width=34% | [[Darkplaces material system | Index]]
| width=33% | [[Darkplaces material system/General Keywords | General Keywords&amp;nbsp;&amp;gt;&amp;gt;]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1526</id>
      <timestamp>2012-07-23T06:20:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="47141">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{| cellspacing=0 cellpadding=5 width=100% border=1 style=&quot;border-collapse: collapse&quot;
! colspan=4 | Darkplaces material system
|-
| width=43% align=right  | [[Darkplaces material system/Introduction | &amp;lt;&amp;lt;&amp;nbsp;Introduction]]
| width=14% align=center | [[Darkplaces material system | Index]]
| width=43% align=left   | [[Darkplaces material system/General Keywords | General Keywords&amp;nbsp;&amp;gt;&amp;gt;]]
|}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1528</id>
      <timestamp>2012-07-23T06:29:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="46827">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{{navigation
|index=Darkplaces material system
|prev=Introduction
|next=General Keywords
}}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1557</id>
      <timestamp>2012-07-23T06:44:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46829">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{{navigation | index=Darkplaces material system | prev=Introduction | next=General Keywords}}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1558</id>
      <timestamp>2012-07-23T06:44:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="46817">= Introduction =
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

{{navigation | Darkplaces material system | p=Introduction | n=General Keywords}}

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

= Special Keywords =

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1595</id>
      <timestamp>2012-07-23T08:46:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11886">* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]

= Stages =

== Base Stage ==

=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

= Credits =
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1665</id>
      <timestamp>2012-07-23T09:42:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="616">== Table of contents ==
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.</text>
    </revision>
    <revision>
      <id>1666</id>
      <timestamp>2012-07-23T09:42:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="658">== Table of contents ==
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1668</id>
      <timestamp>2012-07-23T09:45:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="805">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

== Table of contents ==
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1669</id>
      <timestamp>2012-07-23T09:46:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="888">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Table of contents ==
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1670</id>
      <timestamp>2012-07-23T09:46:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="910">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Table of contents ==
&lt;font size=4&gt;
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1671</id>
      <timestamp>2012-07-23T09:46:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="910">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Table of contents ==
&lt;font size=3&gt;
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1672</id>
      <timestamp>2012-07-23T09:46:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="901">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
* [[Darkplaces material system/Introduction | Introduction]]
* [[Darkplaces material system/Key Concepts | Key Concepts]]
* [[Darkplaces material system/General Keywords | General Keywords]]
* [[Darkplaces material system/Special Keywords | Special Keywords]]
* [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1699</id>
      <timestamp>2012-07-23T10:07:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="956">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
* [[Darkplaces material system/Introduction | Chapter 1. Introduction]]
* [[Darkplaces material system/Key Concepts | Chapter 2. Key Concepts]]
* [[Darkplaces material system/General Keywords | Chapter 3. General Keywords]]
* [[Darkplaces material system/Special Keywords | Chapter 4. Special Keywords]]
* [[Darkplaces material system/Special Keywords | Chapter 5. Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1700</id>
      <timestamp>2012-07-23T10:07:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="941">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

&lt;font size=3&gt;
* [[Darkplaces material system/Introduction | Chapter 1. Introduction]]
* [[Darkplaces material system/Key Concepts | Chapter 2. Key Concepts]]
* [[Darkplaces material system/General Keywords | Chapter 3. General Keywords]]
* [[Darkplaces material system/Special Keywords | Chapter 4. Special Keywords]]
* [[Darkplaces material system/Special Keywords | Chapter 5. Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1701</id>
      <timestamp>2012-07-23T10:07:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="931">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

&lt;font size=3&gt;
[[Darkplaces material system/Introduction | Chapter 1. Introduction]]
[[Darkplaces material system/Key Concepts | Chapter 2. Key Concepts]]
[[Darkplaces material system/General Keywords | Chapter 3. General Keywords]]
[[Darkplaces material system/Special Keywords | Chapter 4. Special Keywords]]
[[Darkplaces material system/Special Keywords | Chapter 5. Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1702</id>
      <timestamp>2012-07-23T10:07:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="935">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

&lt;font size=3&gt;
[[Darkplaces material system/Introduction | Chapter 1. Introduction]]

[[Darkplaces material system/Key Concepts | Chapter 2. Key Concepts]]

[[Darkplaces material system/General Keywords | Chapter 3. General Keywords]]

[[Darkplaces material system/Special Keywords | Chapter 4. Special Keywords]]

[[Darkplaces material system/Special Keywords | Chapter 5. Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1703</id>
      <timestamp>2012-07-23T10:08:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="910">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
[[Darkplaces material system/Introduction | 1. Introduction]]

[[Darkplaces material system/Key Concepts | 2. Key Concepts]]

[[Darkplaces material system/General Keywords | 3. General Keywords]]

[[Darkplaces material system/Special Keywords | 4. Special Keywords]]

[[Darkplaces material system/Special Keywords | 5. Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1709</id>
      <timestamp>2012-07-23T11:51:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="905">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
# [[Darkplaces material system/Introduction | Introduction]]

# [[Darkplaces material system/Key Concepts | Key Concepts]]

# [[Darkplaces material system/General Keywords | General Keywords]]

# [[Darkplaces material system/Special Keywords | Special Keywords]]

# [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1710</id>
      <timestamp>2012-07-23T11:51:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="901">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
# [[Darkplaces material system/Introduction | Introduction]]
# [[Darkplaces material system/Key Concepts | Key Concepts]]
# [[Darkplaces material system/General Keywords | General Keywords]]
# [[Darkplaces material system/Special Keywords | Special Keywords]]
# [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1711</id>
      <timestamp>2012-07-23T11:52:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="990">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
# [[Darkplaces material system/Introduction | Introduction]]
## [[Darkplaces material system/Introduction#What is a Material? | What is a Material?]]
# [[Darkplaces material system/Key Concepts | Key Concepts]]
# [[Darkplaces material system/General Keywords | General Keywords]]
# [[Darkplaces material system/Special Keywords | Special Keywords]]
# [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1712</id>
      <timestamp>2012-07-23T11:52:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1097">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
# [[Darkplaces material system/Introduction | Introduction]]
## [[Darkplaces material system/Introduction#What is a Material? | What is a Material?]]
## [[Darkplaces material system/Introduction#Material names &amp; Conventions | Material names &amp; Conventions]]
# [[Darkplaces material system/Key Concepts | Key Concepts]]
# [[Darkplaces material system/General Keywords | General Keywords]]
# [[Darkplaces material system/Special Keywords | Special Keywords]]
# [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1713</id>
      <timestamp>2012-07-23T11:52:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1099">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
# [[Darkplaces material system/Introduction | Introduction]]
### [[Darkplaces material system/Introduction#What is a Material? | What is a Material?]]
### [[Darkplaces material system/Introduction#Material names &amp; Conventions | Material names &amp; Conventions]]
# [[Darkplaces material system/Key Concepts | Key Concepts]]
# [[Darkplaces material system/General Keywords | General Keywords]]
# [[Darkplaces material system/Special Keywords | Special Keywords]]
# [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1714</id>
      <timestamp>2012-07-23T11:52:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1097">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
# [[Darkplaces material system/Introduction | Introduction]]
## [[Darkplaces material system/Introduction#What is a Material? | What is a Material?]]
## [[Darkplaces material system/Introduction#Material names &amp; Conventions | Material names &amp; Conventions]]
# [[Darkplaces material system/Key Concepts | Key Concepts]]
# [[Darkplaces material system/General Keywords | General Keywords]]
# [[Darkplaces material system/Special Keywords | Special Keywords]]
# [[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1715</id>
      <timestamp>2012-07-23T11:53:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1090">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#*[[Darkplaces material system/Introduction#What is a Material? | What is a Material?]]
#*[[Darkplaces material system/Introduction#Material names &amp; Conventions | Material names &amp; Conventions]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1716</id>
      <timestamp>2012-07-23T11:53:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1130">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#*&lt;font size=2&gt;[[Darkplaces material system/Introduction#What is a Material? | What is a Material?]]&lt;/font&gt;
#*&lt;font size=2&gt;[[Darkplaces material system/Introduction#Material names &amp; Conventions | Material names &amp; Conventions]]&lt;/font&gt;
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>1717</id>
      <timestamp>2012-07-23T11:55:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="896">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2205</id>
      <timestamp>2012-07-30T06:05:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="909">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Special Keywords | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2796</id>
      <timestamp>2012-11-15T07:33:26Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Chapters */</comment>
      <text xml:space="preserve" bytes="899">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Stages | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar adapted for Darkplaces engine.

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3602</id>
      <timestamp>2013-02-20T18:42:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Credits */</comment>
      <text xml:space="preserve" bytes="868">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Stages | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3604</id>
      <timestamp>2013-02-20T18:48:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Credits */</comment>
      <text xml:space="preserve" bytes="915">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Stages | Stages]]
&lt;/font&gt;

== Credits ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar
* Darkplaces and Blood Omnicide part by VorteX

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3605</id>
      <timestamp>2013-02-20T18:48:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Credits */</comment>
      <text xml:space="preserve" bytes="904">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists.

This reference contains all information needed to work with Darkplaces materials.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Stages | Stages]]
&lt;/font&gt;

== Materials used as a base for this reference ==
* [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader Manual] by By Paul Jaquays and Brian Hook
* [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2 Shader manual] by Obsidian and ydnar

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3606</id>
      <timestamp>2013-02-20T18:53:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="991">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This reference contains all information needed to work with Darkplaces materials.

Since Darkplaces material system internals are quite close to [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader System] and Blood Omnicide is using [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2] to build maps, this reference is based on Quake 3/Q3map2 docs, but adapted and extended to Darkplaces way-of-things-done.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Stages | Stages]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3607</id>
      <timestamp>2013-02-20T18:57:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="978">Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. This reference contains all information needed to work with Darkplaces materials.

Since Darkplaces material system are inspired by [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm Quake 3 Shader System] and Blood Omnicide is using [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2] to build maps, this reference is based on Quake 3/Q3map2 docs, but adapted and extended to Darkplaces way-of-things-done.

== Chapters ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduction]]
#[[Darkplaces material system/Key Concepts | Key Concepts]]
#[[Darkplaces material system/General Keywords | General Keywords]]
#[[Darkplaces material system/Special Keywords | Special Keywords]]
#[[Darkplaces material system/Stages | Stages]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces material system/General Keywords</title>
    <ns>0</ns>
    <id>132</id>
      <sha1>7yyq2ia9bz27cfbzob1dkod82z6dsrt</sha1>
    <revision>
      <id>1593</id>
      <timestamp>2012-07-23T08:43:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation | Darkplaces material system| p=Key Concepts | n=Special Keywords}}  = General Keywords =  === surfaceparm ===  This is, by the fact, most widely used and most tr...&quot;</comment>
      <text xml:space="preserve" bytes="13344">{{navigation | Darkplaces material system| p=Key Concepts | n=Special Keywords}}

= General Keywords =

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

{{navigation | Darkplaces material system| p=Key Concepts | n=Special Keywords}}</text>
    </revision>
    <revision>
      <id>1594</id>
      <timestamp>2012-07-23T08:45:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13376">{{navigation | Darkplaces material system | p=Key Concepts | c=General Keywords | n=Special Keywords | caption}}

=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.

{{navigation | Darkplaces material system | p=Key Concepts | c=General Keywords | n=Special Keywords}}</text>
    </revision>
    <revision>
      <id>1662</id>
      <timestamp>2012-07-23T09:40:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13257">{{navigation title|Darkplaces material system|General Keywords|p=Key Concepts|n=Special Keywords}}
=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1676</id>
      <timestamp>2012-07-23T09:49:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13240">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
=== surfaceparm ===

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

==== General surfaceparms ====

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

==== System surfaceparms ====
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

==== Custom surfaceparms ====

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

=== cull none  ===

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

=== deformVertexes ===

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1720</id>
      <timestamp>2012-07-23T12:01:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="13228">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

'''deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

'''deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;'''
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

'''deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;'''
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

'''deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;'''
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

'''deformVertexes autosprite'''
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

'''deformVertexes autosprite2'''
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

'''Specific parameter definitions for deform keywords'''

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1721</id>
      <timestamp>2012-07-23T12:03:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13241">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

=== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions. The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselatino distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

=== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

=== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

=== deformVertexes autosprite ===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

=== deformVertexes autosprite2 ===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

=== Specific parameter definitions for deform keywords ===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1722</id>
      <timestamp>2012-07-23T12:08:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes        */</comment>
      <text xml:space="preserve" bytes="13310">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

=== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

=== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

=== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

=== deformVertexes autosprite ===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

=== deformVertexes autosprite2 ===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

=== Specific parameter definitions for deform keywords ===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1723</id>
      <timestamp>2012-07-23T12:08:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes */</comment>
      <text xml:space="preserve" bytes="13311">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

'''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on common/ilava material.

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:'''Design Notes''': This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:'''Design Notes''': This keyword is used on common/islime material.

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:'''Design Notes''': This keyword is used on '''common/iwater''' material.

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

'''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material.

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

'''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.

'''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

=== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

=== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

=== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.

=== deformVertexes autosprite ===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.

=== deformVertexes autosprite2 ===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

=== Specific parameter definitions for deform keywords ===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

'''Design Notes''': The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</text>
    </revision>
    <revision>
      <id>1838</id>
      <timestamp>2012-07-26T14:37:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>use templates for all notices</comment>
      <text xml:space="preserve" bytes="13189">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

=== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

=== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

=== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

=== deformVertexes autosprite ===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

=== deformVertexes autosprite2 ===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

=== Specific parameter definitions for deform keywords ===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

{{design|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}</text>
    </revision>
    <revision>
      <id>1840</id>
      <timestamp>2012-07-26T14:51:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Specific parameter definitions for deform keywords */</comment>
      <text xml:space="preserve" bytes="13186">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

=== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

=== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

=== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

=== deformVertexes autosprite ===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

=== deformVertexes autosprite2 ===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

=== Specific parameter definitions for deform keywords ===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency/

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}</text>
    </revision>
    <revision>
      <id>1889</id>
      <timestamp>2012-07-26T17:35:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Specific parameter definitions for deform keywords */</comment>
      <text xml:space="preserve" bytes="13186">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
== surfaceparm ==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

=== General surfaceparms ===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

=== System surfaceparms ===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

=== Custom surfaceparms ===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

== cull none  ==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

== deformVertexes ==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

=== deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt; ===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

=== deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt; ===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

=== deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

=== deformVertexes autosprite ===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

=== deformVertexes autosprite2 ===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

=== Specific parameter definitions for deform keywords ===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}</text>
    </revision>
    <revision>
      <id>1893</id>
      <timestamp>2012-07-27T06:59:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>added noPicMip and noMipMaps</comment>
      <text xml:space="preserve" bytes="13734">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}</text>
    </revision>
    <revision>
      <id>1894</id>
      <timestamp>2012-07-27T09:08:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19866">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* distance - default distance-based sorting
* hud - this surface will always be ontop of all another blended materials
* sky - opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it sharp, like a covered by a plastic film. Like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{design|This is a 'hard' shader that requires much computation time. Each materisl with reflection sets additional render pass, dont allow situation where eye can see 2 or more reflective surfaces at a time.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work. Cubemapped reflections alot faster than realtime ones.

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have greater proirity over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.</text>
    </revision>
    <revision>
      <id>1895</id>
      <timestamp>2012-07-27T09:10:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* dpGlossExponentMod  */</comment>
      <text xml:space="preserve" bytes="19870">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* distance - default distance-based sorting
* hud - this surface will always be ontop of all another blended materials
* sky - opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film.  Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{design|This is a 'hard' shader that requires much computation time. Each materisl with reflection sets additional render pass, dont allow situation where eye can see 2 or more reflective surfaces at a time.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work. Cubemapped reflections alot faster than realtime ones.

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have greater proirity over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.</text>
    </revision>
    <revision>
      <id>1896</id>
      <timestamp>2012-07-27T09:11:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* dpNoShaderKillIfCvar    */</comment>
      <text xml:space="preserve" bytes="19864">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* distance - default distance-based sorting
* hud - this surface will always be ontop of all another blended materials
* sky - opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film.  Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{design|This is a 'hard' shader that requires much computation time. Each materisl with reflection sets additional render pass, dont allow situation where eye can see 2 or more reflective surfaces at a time.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work. Cubemapped reflections alot faster than realtime ones.

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.</text>
    </revision>
    <revision>
      <id>1898</id>
      <timestamp>2012-07-27T09:15:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19789">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* distance - default distance-based sorting
* hud - this surface will always be ontop of all another blended materials
* sky - opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.</text>
    </revision>
    <revision>
      <id>1899</id>
      <timestamp>2012-07-27T09:17:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* dpTransparentSort  */</comment>
      <text xml:space="preserve" bytes="19807">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.</text>
    </revision>
    <revision>
      <id>1900</id>
      <timestamp>2012-07-27T09:17:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General surfaceparms */</comment>
      <text xml:space="preserve" bytes="19807">{{navigation title|Darkplaces material system|General Keywords|Special Keywords}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.}}

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.</text>
    </revision>
    <revision>
      <id>2080</id>
      <timestamp>2012-07-27T19:20:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19799">{{navigation title|Key Concepts}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.}}

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.

{{navigation footer|Special Keywords}}</text>
    </revision>
    <revision>
      <id>2288</id>
      <timestamp>2012-07-30T21:45:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19812">{{navigation title|Key Concepts}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.}}

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.

{{navigation footer|Special Keywords}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2327</id>
      <timestamp>2012-07-30T22:09:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="19786">{{navigation title|Key Concepts}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.}}

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.

{{navigation footer|Special Keywords}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2764</id>
      <timestamp>2012-10-10T10:23:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="19786">{{navigation title|Key Concepts}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.}}

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;&lt;wave&gt; &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant/Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.

{{navigation footer|Special Keywords}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3691</id>
      <timestamp>2014-03-09T15:37:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* deformVertexes        */</comment>
      <text xml:space="preserve" bytes="19784">{{navigation title|Key Concepts}}
==surfaceparm==

This is, by the fact, most widely used and most tricky material keyword.

All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader.

This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide.

===General surfaceparms===

'''surfaceparm alphashadow'''
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.
:Used by Q3map2 light phase.
:{{design|Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap.}}

'''surfaceparm detail'''
:This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. It functionality is same as marking brush as detail in level editor.
:Used by Q3map2 BSP phase

'''surfaceparm lava'''
:Assigns to the material the game properties set for lava. This affects contents of the brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on common/ilava material.}}

'''surfaceparm lightfilter'''
:Use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.
:Used by Q3map2 light phase.

'''surfaceparm nodraw'''
:Prevents Q3map2 from generating drawsurfaces for this material.
:Used by Q3map2 BSP phase.

'''surfaceparm nomarks'''
:Prevents engine from spawning decals for this surface.
:Used by engine renderer.
:{{design|Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.}}

'''surfaceparm nolightmap'''
:This surface will have no lightmap generated. This will save some memory and make map compilation faster.
:Used by Q3map2 light phase.
:{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.}}

'''surfaceparm nonsolid'''
:Surface does not block the movement of entities in the game world. This affects the content of a brush. This still make q3map2 generate collision surfaces.
:Used by engine ([[BIH]] collision) and q3map2 (bsp phase).

'''surfaceparm slime'''
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp.
:Used by engine (BIH collision) and q3map2 (bsp phase). 
:{{design|This keyword is used on common/islime material.}}

'''surfaceparm trans'''
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. 
:Used by q3map2 BSP phase. 
:{{design|Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled).}}

'''surfaceparm water'''
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush.
:Used by engine (BIH collision) and q3map2 (bsp phase).
:{{design|This keyword is used on '''common/iwater''' material.}}

===System surfaceparms===
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials.

'''surfaceparm hint'''
:When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set ([[PVS]]). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS.
:Used by Q3map2 BSP phase. This keyword is used on '''common/hint''' material.

'''surfaceparm monsterclip'''
:Surface with this flag will block NPC movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/monsterclip''' material. You dont need to specify it on your new materials.

'''surfaceparm lightgrid'''
:The min/max bounds of brushes with this material in a map will define the bounds of the map's [[Lightgrid]].
:Used by Q3map2 light phase. This keyword is used on '''common/lightgrid''' material. You dont need to specify it on your new materials.

'''surfaceparm playerclip'''
:Surface with this flag will block player movement. Should be used with '''surfaceparm nonsolid'''.
:Used by engine (collision). This keyword is used on '''common/playerclip''' material.

'''surfaceparm origin'''
:Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush.
:Used by q3map2 BSP phase. This keyword is used on '''common/origin''' material

'''surfaceparm structural'''
:This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of common/hint material. Generally speaking, any opaque material not marked as &quot;detail&quot; is, by default, structural, so you shouldn't need to specify this.
:Used by q3map2 BSP phase.

===Custom surfaceparms===

This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound.

Blood Omnicide have this game-physics materials:

* grass 
* ice
* dirt
* wood
* oldwood
* ground
* sand
* dullmetal
* brookwater
* glass
* fur
* marble
* hay
* slate
* flesh
* metal
* oldmetal
* stone
* oldstone
* plan

{{important|Blood Omnicide allows only one game-physics surfaceparm per material.}}

==cull none==

Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.).

To &quot;cull&quot; means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible.

{{tip|[[realtime lighting | Realtime lighting]] and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game.}}

{{design|When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.}}

==noPicMip==
This causes the texture to ignore '''r_picmip''' cvar. The image will always be high resolution. Applicate to a small low-resolution textures that will be overblurred with r_picmip. Not used in Blood Omnicide.
{{bug|Darkplaces can crash if texture have DDS file with no mipmap layers generated and allowed for mipmaps in material. Use this keyword to suppress that.}}

==noMipMaps==
Implies noPicMip. Also prevents the generation of any lower resolution mipmaps for use by the 3D card. This saves 25% of memory used to store this texture (both RAM and VRAM).

==deformVertexes==

This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance.

===deformVertexes &lt;nowiki&gt;wave &lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt; ===
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]].
:The &quot;div&quot; parameter is used to control the wave &quot;spread&quot; - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world).

===deformVertexes normal &lt;nowiki&gt;&lt;div&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude ~0.1-~0.5&gt; &lt;frequency ~1.0-~4.0&gt;&lt;/nowiki&gt;===
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect.

:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up.
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results.

===deformVertexes bulge &lt;nowiki&gt;&lt;bulgeWidth&gt; &lt;bulgeHeight&gt; &lt;bulgeSpeed&gt;&lt;/nowiki&gt;===
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes.

===deformVertexes move &lt;nowiki&gt;&lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;func&gt; &lt;base&gt; &lt;amplitude&gt; &lt;phase&gt; &lt;freq&gt;&lt;/nowiki&gt;===
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The &lt;x&gt; &lt;y&gt; and &lt;z&gt; values are the distance and direction in game units the object appears to move relative to it's point of origin in the map.
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.
:It must be noted that an object made with this shader does not actually change position, it only appears to.
:{{design|If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.}}

===deformVertexes autosprite===
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the &quot;sprite&quot; on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.
:{{design|This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare.}}

===deformVertexes autosprite2===
:Is a slightly modified &quot;sprite&quot; that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.

===Specific parameter definitions for deform keywords===

'''div'''
:This is roughly defined as the size of the waves that occur. It is measured in game units. Smaller values create a greater density of smaller wave forms occurring in a given area. Larger values create a lesser density of waves, or otherwise put, the appearance of larger waves. To look correct this value should closely correspond to the value (in pixels) set for tessSize (tessellation size) of the texture. A value of 100.0 is a good default value (which means your tessSize should be close to that for things to look &quot;wavelike&quot;).

'''func'''
:This is the type of wave form being created. Sin stands for sine wave, a regular smoothly flowing wave. Triangle is a wave with a sharp ascent and a sharp decay. It will make a choppy looking wave forms. A square wave is simply on or off for the period of the frequency with no in between. The sawtooth wave has the ascent of a triangle wave, but has the decay cut off sharply like a square wave. An inversesawtooth wave reverses this.

'''base'''
:This is the distance, in game units that the apparent surface of the texture is displaced from the actual surface of the brush as placed in the editor. A positive value appears above the brush surface. A negative value appears below the brush surface. An example of this is the Quad effect, which essentially is a shell with a positive base value to stand it away from the model surface and a 0 (zero) value for amplitude.

'''amplitude'''
:The distance that the deformation moves away from the base value. See Wave Forms in the introduction for a description of amplitude.

'''phase'''
:See Wave Forms in the introduction for a description of phase.

'''frequency'''
:See Wave Forms in the introduction for a description of frequency.

{{tip|The &lt;nowiki&gt;&lt;div&gt;&lt;/nowiki&gt; and &lt;nowiki&gt;&lt;amplitude&gt;&lt;/nowiki&gt; parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}}

==dpMeshCollisions==
Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled.

==dpPolygonOffset &amp;lt;factor&amp;gt; &amp;lt;offset&amp;gt;==
Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant/Glossary | z-fighting]]. Useful for decals.

Both parameters are optional, if not used, a default factor of 0 and offset -2 is used.

{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}}

==dpTransparentSort &lt;nowiki&gt;&lt;sort&gt;&lt;/nowiki&gt;==
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects.
* '''distance''' : default distance-based sorting
* '''hud''' : this surface will always be ontop of all another blended materials
* '''sky''' : opposite to hud, this surface will always ve vehing all other blender materials.

==Per-Pixel Lightning==
This keywords controls various parameters used by per-pixel lighting of a surface.

===dpShadow===
Forces this material to be shadow caster even if it's blended or not drawn (blended surfaces by default is not casting shadows).
{{tip|This keyword is useful in creating '''shadow meshes''' a meshes that is invisible (and having lower polycont) but used for shadow casting.}}

===dpNoShadow===
Discards material from shadow casting.

===dpNoRtlight===
Disables any realtime lighting on a surface.

===dpGlossIntensityMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Multiplies [[gloss]] intensity of this material. Default value is 1; 0.5 will halve gloss effect intensity, 2.0 will double it etc. This are used ontop on base gloss intensity set by a texture's _gloss color.

===dpGlossExponentMod &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1).

Typical values are 0.25 (wood), 2.0 (glass).

===dpRtlightAmbient &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;===
Smooths out shading of a surface by adding amount of ambient light. This is useful on very grude and lowpoly surfaces (such as grass) because strong shading will show artefacts caused by low detalisation of a mesh.

==Reflection and refraction==
This material keywords allows to add refraction and reflection effects to a surface. All reflective and refractive effects are part of water shader, so they are only visible when '''r_water''' cvar is 1.

===dpReflect &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;a&gt;&lt;/nowiki&gt;===
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.
{{important|This is a 'hard' shader that requires much computation time. Abuse of this will slowdown rendering.}}

===dpRefract &lt;nowiki&gt;&lt;distortion&gt; &lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;===
Works pretty same as reflection and can be combined with it (though it's not good). The refraction replaces the transparency of the texture. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface.

===dpWater &lt;nowiki&gt;&lt;reflectmin&gt; &lt;reflectmax&gt;  &lt;refractdistort&gt; &lt;reflectdistort&gt;  &lt;refractR&gt; &lt;refractG&gt; &lt;refractB&gt;  &lt;reflectR&gt; &lt;reflectG&gt; &lt;reflectB&gt;  &lt;alpha&gt;&lt;/nowiki&gt;===
Add a water shader to a material. This combines the effects of dpreflect and dprefract to simulate a water surface. However, the refraction and the reflection are mixed using a Fresnel equation that makes the amount of reflection slide from reflectmin when looking parallel to the water to reflectmax when looking directly into the water. The result of this reflection/refraction mix is then layered BELOW the texture of the shader, so basically, it &quot;fills up&quot; the alpha values of the water. The alpha value is a multiplicator for the alpha value on the texture (set this to a small value like 0.1) to emphasize the reflection and make the water transparent; but if r_water is 0, alpha isn't used, so the water can be very visible then too.

Typical usage:
 dpwater  0.4 1.0   0.3 1.0   0.28 0.21 0.18   0.80 0.76 0.65   0.0

===dpWaterScroll &lt;nowiki&gt;&lt;speedScale&gt; &lt;globalScale&gt;&lt;/nowiki&gt; ===
Animate surface normalmap in water shader by duplicating it, scrolling, offsetting and multiplying the layers.
{{tip|Globalscale affects speed.}}

===dpCamera===
Flags this surface as camera surface. Used to make portal effects like ones seen in Pray. Not used in Blood Omnicide.

===dpReflectCube &lt;nowiki&gt;&lt;cubemap&gt;&lt;/nowiki&gt;===
Sets static [[cubemap]] texture for reflections. 
{{important|A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work.}}
{{tip|Cubemapped reflections alot faster than realtime ones.}}

Typical usage:

 dpreflectcube textures/environment/reflect1

==Shader Kill==
This keywords are used to hide this material (as if it has no stages) under certain circumstances. Only affects visual appearance of material, not collisions or contents.

===dpShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Kills this material is [[CVar | cvar]] matches a value.
 &lt;font color=green&gt;// kill this shader if r_foo is 42&lt;/font&gt;
 dpshaderkillifcvar r_foo == 42
Operators are:
* '''==''' - equal
* '''!=''' - not equal
* '''&gt;''' - greater
* '''&gt;=''' - greater or equal
* '''&lt;''' - lesser
* '''&lt;=''' - lesser or equal

===dpNoShaderKillIfCvar &lt;nowiki&gt;&lt;cvar&gt; &lt;operator&gt; &lt;value&gt;&lt;/nowiki&gt;===
Prevents material from being killed. Have a priority over dpshaderkillifcvar.

===dpShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Kills material is supplied cvar's float value is 0.

===dpNoShaderKillIfCvarZero &lt;nowiki&gt;&lt;cvar&gt;&lt;/nowiki&gt;===
Opposite to above.

{{navigation footer|Special Keywords}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces material system/Introduction</title>
    <ns>0</ns>
    <id>130</id>
      <sha1>ptclf1lrtao6chr6qofjdf05h5px1p8</sha1>
    <revision>
      <id>1575</id>
      <timestamp>2012-07-23T08:15:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation | Darkplaces material system | p= | n=Key Concepts}}  Darkplaces material system is created to put more direct control over the surfaces qualities of textures int...&quot;</comment>
      <text xml:space="preserve" bytes="7291">{{navigation | Darkplaces material system | p= | n=Key Concepts}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system | p= | n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1577</id>
      <timestamp>2012-07-23T08:19:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7308">{{navigation | Darkplaces material system | p= | n=Key Concepts}}
= Introduction =

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system | p= | n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1597</id>
      <timestamp>2012-07-23T08:49:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7330">{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts
|caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1598</id>
      <timestamp>2012-07-23T08:49:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7329">{{navigation | Darkplaces material system
|p=
|c=Introduction
|n=Key Concepts
|caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1599</id>
      <timestamp>2012-07-23T08:49:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7325">{{navigation | Darkplaces material system|p=|c=Introduction|n=Key Concepts|caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1600</id>
      <timestamp>2012-07-23T08:49:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7329">{{navigation | Darkplaces material system
|p=
|c=Introduction
|n=Key Concepts
|caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1601</id>
      <timestamp>2012-07-23T08:49:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7327">{{navigation|Darkplaces material system
|p=
|c=Introduction
|n=Key Concepts
|caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1602</id>
      <timestamp>2012-07-23T08:50:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7328">{{navigation | Darkplaces material system
p=|
c=Introduction|
n=Key Concepts|
caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1603</id>
      <timestamp>2012-07-23T08:50:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7329">{{navigation | Darkplaces material system|
p=|
c=Introduction|
n=Key Concepts|
caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1604</id>
      <timestamp>2012-07-23T08:50:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7328">{{navigation | Darkplaces material system
|p=
|c=Introduction
|n=Key Concepts
caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1605</id>
      <timestamp>2012-07-23T08:51:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7329">{{navigation | Darkplaces material system| p=| c=Introduction| n=Key Concepts| caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system 
|p=
|c=Introduction
|n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1606</id>
      <timestamp>2012-07-23T08:54:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7331">{{navigation | Darkplaces material system | Introduction | p= | n=Key Concepts | caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system | Introduction | p= | n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1607</id>
      <timestamp>2012-07-23T08:55:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7330">{{navigation | Darkplaces material system| Introduction | p= | n=Key Concepts | caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system | Introduction | p= | n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1608</id>
      <timestamp>2012-07-23T08:55:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7327">{{navigation | Darkplaces material system|Introduction | p= | n=Key Concepts | caption}}

Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system|Introduction | p= | n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1652</id>
      <timestamp>2012-07-23T09:34:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7326">{{navigation | Darkplaces material system|Introduction | p= | n=Key Concepts | caption}}
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

{{navigation | Darkplaces material system|Introduction | p= | n=Key Concepts}}</text>
    </revision>
    <revision>
      <id>1653</id>
      <timestamp>2012-07-23T09:35:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7237">{{navigation | Darkplaces material system |Introduction | p= | n=Key Concepts}}
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1657</id>
      <timestamp>2012-07-23T09:37:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7230">{{navigation|Darkplaces material system|Introduction|p=|n=Key Concepts}}
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1660</id>
      <timestamp>2012-07-23T09:38:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7236">{{navigation title|Darkplaces material system|Introduction|p=|n=Key Concepts}}
Darkplaces material system is created to put more direct control over the surfaces qualities of textures into the hands of designers and artists. 

=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1667</id>
      <timestamp>2012-07-23T09:43:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7088">{{navigation title|Darkplaces material system|Introduction|p=|n=Key Concepts}}
=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1673</id>
      <timestamp>2012-07-23T09:48:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7083">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parameters&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;q3map_textureImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1697</id>
      <timestamp>2012-07-23T10:06:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="7000">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''

    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1698</id>
      <timestamp>2012-07-23T10:06:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* What is a Material? */</comment>
      <text xml:space="preserve" bytes="7001">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1704</id>
      <timestamp>2012-07-23T10:10:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7075">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).

[[Darkplaces material syatem/Key Concepts | Next chapter: Key Concepts]]</text>
    </revision>
    <revision>
      <id>1705</id>
      <timestamp>2012-07-23T10:10:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Types */</comment>
      <text xml:space="preserve" bytes="7001">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
=== What is a Material? ===
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

=== Material names &amp; Conventions ===
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

==== Material scripts Formatting ====

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

=== Inspired by Quake 3 but different ===
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

==== Realtime lighting ====
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

==== New keywords ====
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

==== Q3 Texture = Darkplaces skinframe ====
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

==== Different speed costs ====
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

==== Material is 'Shader' ====
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1707</id>
      <timestamp>2012-07-23T10:13:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6983">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

=== Material Types ===
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1708</id>
      <timestamp>2012-07-23T10:14:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6981">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 materialname
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     &amp;lt;Engine Specific Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1778</id>
      <timestamp>2012-07-26T05:47:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material scripts Formatting */</comment>
      <text xml:space="preserve" bytes="6951">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw: 0 stages
* Unlit texture: 1 stage
* Lit texture: 2 stages
* Lit texture with terrain blending: 3 stages
All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1779</id>
      <timestamp>2012-07-26T05:54:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>changed description</comment>
      <text xml:space="preserve" bytes="7060">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

'''Design Notes:''' To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

'''IMPORTANT NOTE''': some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).</text>
    </revision>
    <revision>
      <id>1836</id>
      <timestamp>2012-07-26T14:33:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7043">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end (see various examples).}}</text>
    </revision>
    <revision>
      <id>1837</id>
      <timestamp>2012-07-26T14:34:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Material Types */</comment>
      <text xml:space="preserve" bytes="7020">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material atatched (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}</text>
    </revision>
    <revision>
      <id>2059</id>
      <timestamp>2012-07-27T18:17:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Realtime lighting */</comment>
      <text xml:space="preserve" bytes="7020">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material attached (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}</text>
    </revision>
    <revision>
      <id>2061</id>
      <timestamp>2012-07-27T18:37:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7096">{{navigation title|Darkplaces material system|Introduction|Key Concepts}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material attached (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}

{{navigation footer|Darkplaces material system|Introduction|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2065</id>
      <timestamp>2012-07-27T18:51:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7084">{{navigation title|Darkplaces material system|Introduction|}}
== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material attached (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}

{{navigation footer|Darkplaces material system|Introduction|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2072</id>
      <timestamp>2012-07-27T19:01:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7101">{{navigation title|Darkplaces material system|Introduction|}}
{{SUBPAGENAME}}

== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material attached (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}

{{navigation footer|Darkplaces material system|Introduction|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2073</id>
      <timestamp>2012-07-27T19:10:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7005">{{navigation title|}}

== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material attached (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}

{{navigation footer|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2290</id>
      <timestamp>2012-07-30T21:45:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7018">{{navigation title|}}

== What is a Material? ==
Materials are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; textures_inn, models_mapobjects_crypt, etc,). Several specific script documents have also been created to handle special cases, like liquids, environments and special effects.

For Darkplaces, material scripts are located in 'Path_To_The_Game/gamedir/scripts'.

A Darkplaces material file consists of a series of surface attribute and rendering instructions formatted within braces (&quot;{&quot; and &quot;}&quot;). Below you can see a simple example of syntax and format for a single process, including the [[Q3map | Q3MAP]] keywords or &quot;Surface Parameters&quot;, which follow the first bracket and a single bracketed &quot;stage&quot;:

 &lt;font color=green&gt;// material definition&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// keywords&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// base stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// engine will search fo textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// lighting stage&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Material names &amp; Conventions ==
The first line is the material name. Material names can be up to 63 characters long. The names are often a mirror of a pathname to a .tga file without the extension or basedir (/Blood Omnicide/kain in our case), but they do not need to be.

Materials that are only going to be referenced by the game code, not modeling tools, often are just a single world, like &quot;collision&quot; or &quot;dpbihclip&quot;.

Materials that are used on characters or other polygon models need to mirror a .tga file, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.

Materials that are placed on surfaces in the map editor commonly mirror a .tga file, but the &quot;qer_editorimage&quot; material parameter can force the editor to use an arbitrary image for display.

Material pathnames have a case sensitivity issue - on windows, they aren't case sensitive, but on unix they are. Try to always use lowercase for filenames, and always use forward slashes &quot;/&quot; for directory separators.

=== Material scripts Formatting ===

In order to get materials to be easily readable and editable it is recommended to format all material scripts like this template:

 &amp;lt;materialname&amp;gt;
 {
     &amp;lt;Editor Specific Keywords&amp;gt;
 
     &amp;lt;Q3Map2 Specific Keywords&amp;gt;
     &amp;lt;General Keywords&amp;gt;
     {
          &amp;lt;Stage Keywords&amp;gt;
     }
 }

== Inspired by Quake 3 but different ==
Quake 3 shader scripts was an inspiration for darkplaces material system and visual look of material scripts is very very close to quake 3. So if you are familiar with Id Tech 3 [[Shader | shaders]] system, you will be right home with material script syntax. Therefore Darkplaces material system was written independently and there is some serious differences:

=== Realtime lighting ===
Any shader keywords that is not compatible with realtime lighting was removed. Other ones have sligtly changed behavior.

Aiming to realtime lighting changes the way stages working. There is no render passes (so multilayered material can only be created by duplicating real surfaces). 
Darkplaces material render pipeline can have 1 to 3 fixed usage stages:
* No draw (0 stages)
* Unlit texture (1 stage)
* Lit texture (2 stages)
* Lit texture with terrain blending (3 stages)

All other Id Tech 3 stage configuration such as skies are not supported.

{{design|To simulate multilayer materials, should make several copies of surface with different material attached (for map surfaces can use Q3map2's cloneShader keyword)}}

=== New keywords ===
Darkplaces introduces many of it's own keywords that not exist in Id Tech 3.

=== Q3 Texture = Darkplaces skinframe ===
Id tech 3 only need color info for texture. Darkplaces engine using normalmap, specularity map, glow texture and other textures that store additional info. All that texture files toggether (color + normalmap + glossmap + glow etc.) forms a skinframe. 
Read more at [[Texture]] article.

=== Different speed costs ===
Darkplaces's engine rendering pipeline is very different from Id Tech 3. By using pixel and vertex shaders, it introduces new speed cost parameters that was not exist in Idtech 3:
* shader instructions - amount of vertex and pixel shader instructions generated for particular material (depends of effects used)
* texture lookups - amount of texture lookups in pixel shader, additional textures in a skinframe, parallax mapping increase amount of texture lookups
* use of VBO - non-animated models render faster with VBO, some shader keywords (such as tcMod turbulent, deformVertexes) disables VBO 
* use of Lighting - realtime light is slower on blended (add more draws of surface, one per light) or offset mapped surfaces (offset mapping is processed again for each light) 

=== Material is 'Shader' ===
Since Darkplaces uses tools with Id Tech 3 roots, materials is often spelled as 'shaders' there. To not be confused, this terms are identical in q3 tools:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Material Types ==
The keywords that affect materials are divided into three classes. The first class of keywords are global parameters. Some global parameters ( &quot;surfaceparms&quot; And all &quot;q3map_&quot; keywords) are processed by [[Q3Map2 | Q3MAP2]] and change physical attributes of the surface that uses the material. These attributes can affect the player. To see changes in these parameters one must re-compile the [[MAP | map]].

Second class are keywords parsed by engine server part (surfaceparms, some other keywords). They are changes physical properties of surface and can affact gameplay.

The remaining global keywords, and all Stage Specific Keywords are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command vid_restart in the game [[Console | console]]).

Material keywords are not case sensitive.

{{important|some of the material commands may be order dependent, so it's good practice to place all global material commands (keywords defined in this section) at the very beginning of the material and to place material stages at the end.}}

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces material system/Key Concepts</title>
    <ns>0</ns>
    <id>131</id>
      <sha1>rokqiy1zi9k1n4dbsiefq6q8i1uql4h</sha1>
    <revision>
      <id>1591</id>
      <timestamp>2012-07-23T08:41:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation | Darkplaces material system| p=Introduction | n=General Keywords}}  = Key Concepts =  Ideally, a designer or artist who is manipulating textures with material fi...&quot;</comment>
      <text xml:space="preserve" bytes="8026">{{navigation | Darkplaces material system| p=Introduction | n=General Keywords}}

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1592</id>
      <timestamp>2012-07-23T08:41:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8108">{{navigation | Darkplaces material system| p=Introduction | n=General Keywords}}

= Key Concepts =

Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

{{navigation | Darkplaces material system| p=Introduction | n=General Keywords}}</text>
    </revision>
    <revision>
      <id>1659</id>
      <timestamp>2012-07-23T09:38:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8021">{{navigation title|Darkplaces material system|Key Concepts|p=Introduction|n=General Keywords}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1675</id>
      <timestamp>2012-07-23T09:49:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8004">{{navigation title|Darkplaces material system|Key Concepts|General Keywords}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

=== Power has a Price ===
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

=== RGB Color ===
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

=== Normalization: a scale of 0 to 1 ===
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

=== Texture Sizes ===
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

=== Measurements ===
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

=== Waveform Functions ===

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1718</id>
      <timestamp>2012-07-23T11:57:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7992">{{navigation title|Darkplaces material system|Key Concepts|General Keywords}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

== Power has a Price ==
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

== RGB Color ==
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

== Normalization: a scale of 0 to 1 ==
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

== Texture Sizes ==
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

== Measurements ==
The measurements used in the materials are in either game units, color units, or texture coordinates.

'''Game unit'''
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

'''Color units'''
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

'''[[Texture coordinates]]'''
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

== Waveform Functions ==

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1719</id>
      <timestamp>2012-07-23T11:58:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7998">{{navigation title|Darkplaces material system|Key Concepts|General Keywords}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

== Power has a Price ==
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

== RGB Color ==
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

'''NOTE:''' often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.

== Normalization: a scale of 0 to 1 ==
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

== Texture Sizes ==
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

== Measurements ==
The measurements used in the materials are in either game units, color units, or texture coordinates.

=== Game unit ===
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

=== Color units ===
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

=== [[Texture coordinates]] ===
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

== Waveform Functions ==

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1834</id>
      <timestamp>2012-07-26T14:32:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7994">{{navigation title|Darkplaces material system|Key Concepts|General Keywords}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

== Power has a Price ==
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

== RGB Color ==
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 

{{tip:often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.}}

== Normalization: a scale of 0 to 1 ==
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

== Texture Sizes ==
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

== Measurements ==
The measurements used in the materials are in either game units, color units, or texture coordinates.

=== Game unit ===
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

=== Color units ===
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

=== [[Texture coordinates]] ===
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

== Waveform Functions ==

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>1835</id>
      <timestamp>2012-07-26T14:33:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7993">{{navigation title|Darkplaces material system|Key Concepts|General Keywords}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

== Power has a Price ==
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

== RGB Color ==
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 
{{tip|often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.}}

== Normalization: a scale of 0 to 1 ==
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

== Texture Sizes ==
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

== Measurements ==
The measurements used in the materials are in either game units, color units, or texture coordinates.

=== Game unit ===
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

=== Color units ===
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

=== [[Texture coordinates]] ===
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

== Waveform Functions ==

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</text>
    </revision>
    <revision>
      <id>2077</id>
      <timestamp>2012-07-27T19:18:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7989">{{navigation title|Introduction}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

== Power has a Price ==
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

== RGB Color ==
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 
{{tip|often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.}}

== Normalization: a scale of 0 to 1 ==
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

== Texture Sizes ==
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

== Measurements ==
The measurements used in the materials are in either game units, color units, or texture coordinates.

=== Game unit ===
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

=== Color units ===
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

=== [[Texture coordinates]] ===
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

== Waveform Functions ==

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

{{navigation footer|General Keywords}}</text>
    </revision>
    <revision>
      <id>2289</id>
      <timestamp>2012-07-30T21:45:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8002">{{navigation title|Introduction}}
Ideally, a designer or artist who is manipulating textures with material files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make materials work for you.

Materials not only modify the visible aspect of textures on a geometry [[Brush | brush]], [[Patch mesh | curve]] or mesh model, but they can also have an effect on both the content, &quot;shape&quot; and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content materials affect the way the brush operates in the game world. Examples include water, nonsolid, and detail. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.

== Power has a Price ==
The material script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Many OpenGL 2.0 effects attached with material keywords (such as [[water shader]], [[refraction]] cubemap, [[offset mapping]]) makes renderer to do more calculations, which take more CPU/GPU time and make game slower. Water shader surface will draw a world 2 times to get reflective and refractive image, refraction cubemap will add one more texture sampler, parallax mapping will make more texture lookups (from 3 for traditional offset mapping to 14-15 for relief mapping). Blended surfaces will be drawn twice if lit by one or more realtime lights (this means their triangle count will have double effect on r_speeds).

== RGB Color ==
RGB means &quot;Red, Green, Blue&quot;. Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Darkplaces engine and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbblack is 0 0 0. The value for ers. The value for complete complete white is 255 255 255. However, the Darkplaces graphics engine requires that the color range be &quot;normalized&quot; into a range between 0.0 and 1.0. 
{{tip|often you can see RGBA abbreviation which stands for 'RGB + alpha', this is RGB with one more channel - transparency channel. 32-bit images is RGBA, while 24-bit is RGB.}}

== Normalization: a scale of 0 to 1 ==
The mathematics in Darkplaces engine use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Darkplaces formula for that color component. The same holds true for [[texture coordinates]].

== Texture Sizes ==
Texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.

== Measurements ==
The measurements used in the materials are in either game units, color units, or texture coordinates.

=== Game unit ===
:A game unit is used by deformations to specify sizes relative to the world. In Blood Omnicide 16 units equals one foot, 48 units equals to one meter. The default texture scale used by the NetRadiant map editor results in two texels for each game unit, but that can be freely changed and perturbated with material scripts.

=== Color units ===
:Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.

=== [[Texture coordinates]] ===
:This is the normalized (see above) dimensions of the original texture image. A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.

== Waveform Functions ==

Some of the material rendering functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated keyword functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in material scripts:

* '''sin''': sine wave, a regular smoothly flowing wave ranging from -1 to 1.
* '''triangle''': triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make a choppy looking wave forms.
* '''square''': a square wave simply switches from -1 to 1 with no in-between.
* '''sawtooth''': in the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.
* '''inversesawtooth''': this is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.

Waveforms all have the following properties:

'''base'''
:Where the wave form begins. Amplitude is measured from this base value.

'''amplitude''' 
:This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.

'''phase'''
:This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phase of 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in material, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single material, but with the phases shifted can be used to create interesting visual effects. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate material for each, changing only the phase value.

'''freq'''
:Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

{{navigation footer|General Keywords}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces material system/Special Keywords</title>
    <ns>0</ns>
    <id>133</id>
      <sha1>kzllmjr166thhk3f7ao01pmhabl8uj5</sha1>
    <revision>
      <id>1596</id>
      <timestamp>2012-07-23T08:47:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation | Darkplaces material system | p=General Keywords | c=Special Keywords | n=Stages | caption}}  === Q3Map2 Specific Keywords ===  All of q3map2 specific keywords a...&quot;</comment>
      <text xml:space="preserve" bytes="6988">{{navigation | Darkplaces material system | p=General Keywords | c=Special Keywords | n=Stages | caption}}

=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation | Darkplaces material system | p=General Keywords | c=Special Keywords | n=Stages }}</text>
    </revision>
    <revision>
      <id>1663</id>
      <timestamp>2012-07-23T09:41:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6973">{{navigation title|Darkplaces material system|Special Keywords|p=General Keywords|n=Stages}}
=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation | Darkplaces material system | p=General Keywords | c=Special Keywords | n=Stages }}</text>
    </revision>
    <revision>
      <id>1677</id>
      <timestamp>2012-07-23T09:49:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6952">{{navigation title|Darkplaces material system|Special Keywords|Stages}}
=== Q3Map2 Specific Keywords ===

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

=== Editor Specific Keywords ===

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

'''qer_editorImage &amp;lt;textureName&amp;gt;'''
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

'''qer_trans &amp;lt;N.N&amp;gt;'''
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

'''qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt;'''
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation | Darkplaces material system | p=General Keywords | c=Special Keywords | n=Stages }}</text>
    </revision>
    <revision>
      <id>1724</id>
      <timestamp>2012-07-23T12:09:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6855">{{navigation title|Darkplaces material system|Special Keywords|Stages}}
== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:'''IMPORTANT NOTE''': Abuse of this can create a huge number of triangles.

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
'''Design Notes''': q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal</text>
    </revision>
    <revision>
      <id>1897</id>
      <timestamp>2012-07-27T09:13:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Q3Map2 Specific Keywords */</comment>
      <text xml:space="preserve" bytes="6835">{{navigation title|Darkplaces material system|Special Keywords|Stages}}
== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
{{Important|Abuse of this can create a huge number of triangles.}}

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.}}

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 {{design|Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.}}
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal</text>
    </revision>
    <revision>
      <id>1977</id>
      <timestamp>2012-07-27T12:46:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6859">{{article unfinished}}

{{navigation title|Darkplaces material system|Special Keywords|Stages}}
== Q3Map2 Specific Keywords ==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
{{Important|Abuse of this can create a huge number of triangles.}}

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.}}

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 {{design|Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.}}
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

== Editor Specific Keywords ==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

=== qer_editorImage &amp;lt;textureName&amp;gt; ===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

=== qer_trans &amp;lt;N.N&amp;gt; ===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

=== qer_alphaFunc &amp;lt;func&amp;gt; &amp;lt;N.N&amp;gt; ===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal</text>
    </revision>
    <revision>
      <id>1978</id>
      <timestamp>2012-07-27T12:47:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6876">{{navigation title|Darkplaces material system|Special Keywords|Stages}}
{{article unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
{{Important|Abuse of this can create a huge number of triangles.}}

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.}}

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 {{design|Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.}}
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal</text>
    </revision>
    <revision>
      <id>2000</id>
      <timestamp>2012-07-27T14:01:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6868">{{navigation title|Darkplaces material system|Special Keywords|Stages}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
{{Important|Abuse of this can create a huge number of triangles.}}

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.}}

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 {{design|Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.}}
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal</text>
    </revision>
    <revision>
      <id>2081</id>
      <timestamp>2012-07-27T19:21:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6864">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

'''q3map_globalTexture'''
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

'''q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;'''
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
{{Important|Abuse of this can create a huge number of triangles.}}

'''q3map_backShader &amp;lt;shadername&amp;gt;'''
This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.}}

 '''q3map_sun &lt;nowiki&gt;&lt;red&gt; &lt;green&gt; &lt;blue&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt;&lt;/nowiki&gt;'''
 This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of  q3map.
 &lt;red&gt; &lt;green&gt; &lt;blue&gt; Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
 &lt;intensity&gt; is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
 &lt;degrees&gt; is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
 &lt;elevation&gt; is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon
 {{design|Sky shaders should probably still have a q3map_surfacelight value. The &quot;sun&quot; gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the &quot;sun&quot; or &quot;moon&quot; will cast stronger, shadows that have a greater degree of contrast.}}
 Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.

 '''q3map_surfaceLight &lt;nowiki&gt;&lt;light value&gt;&lt;/nowiki&gt;'''
 The texture gives off light equal to the &lt;light value&gt; set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.

 '''q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;'''
 The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
 The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows:
 1) q3map_lightimage ; (the texture providing the light and the color of the light)
 2) qer_editorimage ; (the editor-only image used to select the source map for the texture)
 3) the average color of the light emitted from the shader is calculated from the lightimage.)

 '''q3map_lightsubdivide &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;'''
 This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2119</id>
      <timestamp>2012-07-27T22:38:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13632">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip:forceMets is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:[[vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightimage (the texture providing the light and the color of the light)
:# qer_editorimage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
{{tip:This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2120</id>
      <timestamp>2012-07-27T22:39:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_lightRGB    */</comment>
      <text xml:space="preserve" bytes="13634">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip:forceMets is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:[[vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightimage (the texture providing the light and the color of the light)
:# qer_editorimage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip:This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2121</id>
      <timestamp>2012-07-27T22:39:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13634">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:[[vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightimage (the texture providing the light and the color of the light)
:# qer_editorimage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2122</id>
      <timestamp>2012-07-27T22:40:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_vertexPointSample  */</comment>
      <text xml:space="preserve" bytes="13652">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightimage (the texture providing the light and the color of the light)
:# qer_editorimage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2123</id>
      <timestamp>2012-07-27T22:40:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13659">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightimage (the texture providing the light and the color of the light)
:# qer_editorimage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2124</id>
      <timestamp>2012-07-27T22:41:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_vertexPointSample  */</comment>
      <text xml:space="preserve" bytes="13628">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightimage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightimage (the texture providing the light and the color of the light)
:# qer_editorimage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2125</id>
      <timestamp>2012-07-27T22:41:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_lightimage  */</comment>
      <text xml:space="preserve" bytes="13628">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General q3map keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

=== Lighting-related q3map keywords ===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2126</id>
      <timestamp>2012-07-27T22:52:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13844">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Supports two functions which do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]].

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2127</id>
      <timestamp>2012-07-27T22:54:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="13613">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]].

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2128</id>
      <timestamp>2012-07-27T23:25:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15484">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;'' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;'' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;'' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;'' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value. 

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component (which is used for terrain blending, vertex controlled transparency and some other effects). Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;'' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;'' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;'' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;'' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;'' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;'' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;'' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;'' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;'' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;'' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2129</id>
      <timestamp>2012-07-27T23:25:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_colorMod  */</comment>
      <text xml:space="preserve" bytes="15487">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component (which is used for terrain blending, vertex controlled transparency and some other effects). Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;'' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;'' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;'' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;'' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;'' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;'' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;'' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;'' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;'' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;'' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2130</id>
      <timestamp>2012-07-27T23:26:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15585">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''q3map_tcMod rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''q3map_tcMod scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''q3map_tcMod translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component (which is used for terrain blending, vertex controlled transparency and some other effects). Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2131</id>
      <timestamp>2012-07-27T23:26:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_tcMod  */</comment>
      <text xml:space="preserve" bytes="15549">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component (which is used for terrain blending, vertex controlled transparency and some other effects). Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2132</id>
      <timestamp>2012-07-27T23:27:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Per-vertex RGBA tweaks */</comment>
      <text xml:space="preserve" bytes="15584">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component (which is used for terrain blending, vertex controlled transparency and some other effects). Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2133</id>
      <timestamp>2012-07-27T23:27:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_alphaMod  */</comment>
      <text xml:space="preserve" bytes="15492">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2134</id>
      <timestamp>2012-07-27T23:28:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_colorMod  */</comment>
      <text xml:space="preserve" bytes="15519">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it.
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2135</id>
      <timestamp>2012-07-27T23:28:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_alphaMod  */</comment>
      <text xml:space="preserve" bytes="15546">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lave un slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2136</id>
      <timestamp>2012-07-27T23:28:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_alphaMod  */</comment>
      <text xml:space="preserve" bytes="15546">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's LightContributionToPoint function (instead of default LightContributionToSample which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2137</id>
      <timestamp>2012-07-27T23:29:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_vertexPointSample */</comment>
      <text xml:space="preserve" bytes="15554">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* greater - greater than
:* gequal - greater or equal
:* lesser - lesser than
:* lequal - lesser or equal
:* equal - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2138</id>
      <timestamp>2012-07-27T23:29:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* qer_alphaFunc   */</comment>
      <text xml:space="preserve" bytes="15584">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|q3map_backShader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|q3map_backShader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* '''greater''' - greater than
:* '''gequal''' - greater or equal
:* '''lesser''' - lesser than
:* '''lequal''' - lesser or equal
:* '''equal''' - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2139</id>
      <timestamp>2012-07-27T23:33:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_backShader  */</comment>
      <text xml:space="preserve" bytes="15574">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|Back shader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|Back shader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturepath/texturename&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* '''greater''' - greater than
:* '''gequal''' - greater or equal
:* '''lesser''' - lesser than
:* '''lequal''' - lesser or equal
:* '''equal''' - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2140</id>
      <timestamp>2012-07-27T23:34:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_lightImage  */</comment>
      <text xml:space="preserve" bytes="15562">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|Back shader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|Back shader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_lightImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* '''greater''' - greater than
:* '''gequal''' - greater or equal
:* '''lesser''' - lesser than
:* '''lequal''' - lesser or equal
:* '''equal''' - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2141</id>
      <timestamp>2012-07-27T23:38:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15562">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|Back shader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|Back shader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz )====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_lightImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* '''greater''' - greater than
:* '''gequal''' - greater or equal
:* '''lesser''' - lesser than
:* '''lequal''' - lesser or equal
:* '''equal''' - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2142</id>
      <timestamp>2012-07-27T23:39:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* q3map_tcGen ivector ( Sx Sy Sz ) ( Tx Ty Tz ) */</comment>
      <text xml:space="preserve" bytes="15591">{{navigation title|General Keywords}}
{{unfinished}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|Back shader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|Back shader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector &lt;nowiki&gt;( &lt;Sx&gt; &lt;Sy&gt; &lt;Sz&gt; ) ( &lt;Tx&gt; &lt;Ty&gt; &lt;Tz&gt; )&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_lightImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* '''greater''' - greater than
:* '''gequal''' - greater or equal
:* '''lesser''' - lesser than
:* '''lequal''' - lesser or equal
:* '''equal''' - equal

{{navigation footer|Stages}}</text>
    </revision>
    <revision>
      <id>2277</id>
      <timestamp>2012-07-30T20:42:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="15589">{{navigation title|General Keywords}}

==Q3Map2 Specific Keywords==

All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.

===General use keywords===

====q3map_globalTexture====
:This keyword disables texture coordinates optimization for texture projection on [[Brush | brushes]] (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying '''tcMod scale''' to several adjastent brushes, which can be wrong if not using this parameter. 

====q3map_tessSize &lt;nowiki&gt;&lt;amount&gt;&lt;/nowiki&gt;====
:Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. 
:{{Important|Abuse of this can create a huge number of triangles.}}

====q3map_invert====
:Inverts a surface normal. Works on brush faces, models and patches.

====q3map_offset &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;====
:Offsets a surface along the vertex normals N.N game units.

====q3map_cloneShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:A shader with this keyword will inherit the target shader's properties and appearance.
:{{important|Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.}}

====q3map_backShader &lt;nowiki&gt;&lt;materialName&gt;&lt;/nowiki&gt;====
:This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside.
:{{design|Back shader is a better alternative to '''cull none''' because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used too many times.}}
:{{tip|Back shader is identical to q3map_cloneShader (with cloned shader having q3map_invert)}}

====q3map_tcGen ivector &lt;nowiki&gt;( &lt;Sx&gt; &lt;Sy&gt; &lt;Sz&gt; ) ( &lt;Tx&gt; &lt;Ty&gt; &lt;Tz&gt; )&lt;/nowiki&gt;====
:Generate new texture coordinates for a surface. Projects a texture S units by T units along a chosen axis. q3map_tcGen vector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.

====q3map_tcMod &lt;nowiki&gt;&lt;function&gt;&lt;/nowiki&gt;====
:This works in a similar manner to the stage-specific tcMod keyword, except in the compiler, so that modified texture coordinates are &quot;baked&quot; into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).
:* '''rotate &lt;nowiki&gt;&lt;degrees&gt;&lt;/nowiki&gt;''' - Rotates the texture (around origin, not center) a specified number of degrees.
:* '''scale &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Scales S (x) and T (y) texture coordinates. Scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).
:* '''translate &lt;nowiki&gt;&lt;S&gt; &lt;T&gt;&lt;/nowiki&gt;''' - Shifts texture coordinates by S, T amount. Translate 0.5 0 would shift it one-half in S, and none in T.

====q3map_noClip====
:Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. This keyword forces Q3Map2 to uses the original brush faces.

====q3map_noTJunc====
:Read as &quot;no T-Junc&quot;. With this option, surfaces with this material are not used for T-junction fixing. 
:{{tip|q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.}}

===Per-vertex RGBA tweaks===
This keywords are used to tweak generation of per-vertex RGBA components which is normally used for [[vertex lighting]] and [[terrain blending]]/[[vertex controlled transparency]].

====q3map_colorMod &lt;function&gt;====
:Used to generate or modify RGB component on all surface vertices. Functions are:
:* '''set &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - replace vertex RGB with supplied values.
:* '''scale &lt;nowiki&gt;( &lt;r&gt; &lt;g&gt; &lt;b&gt; )&lt;/nowiki&gt;''' - multiplies RGB with supplied values.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - multiplies color by dotproduct of vertex normal and given vector.
:* '''dotproduct2 &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).

====q3map_alphaMod &lt;function&gt;====
:Work in similar way as q3map_colorMod but affects alpha component. Functions are:
:* '''set &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - replace vertex alpha.
:* '''scale &lt;nowiki&gt;&lt;value&gt;)&lt;/nowiki&gt;''' - multiply vertex alpha.
:* '''dotproduct &lt;nowiki&gt;( &lt;X&gt; &lt;Y&gt; &lt;Z&gt; )&lt;/nowiki&gt;''' - same thing as for q3map_colorMod.
:* '''random &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - sets the random alpha to vertexes in A-B range (this will keep junctions - vertices at same origin will receive same random value).
:* '''randomjitter &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value gets added, not replaced.
:* '''randomscale &lt;nowiki&gt;&lt;A.A&gt; &lt;B.B&gt;&lt;/nowiki&gt;''' - works like random but value is a multiplier.
:* '''volume''' - a special keyword that lets a brush to affect all vertices inside it (see [[colormod brushes]]).
:* '''wateralpha &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - this sets alpha only on surfaces with surfaceparm water, lava or slime. Should be used in conjunction with '''q3map_alphaMod volume'''.
:* '''waterspring &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''watermove &lt;nowiki&gt;&lt;A.A&gt; &lt;F.F&gt;&lt;/nowiki&gt;''' - obsolete, dont use.
:* '''waterwarp &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;''' - obsolete, dont use.

====q3map_alphaLayers &lt;nowiki&gt;&lt;backgroundIndex&gt; &lt;foregroundIndex&gt;&lt;/nowiki&gt;====
:This keyword is used to assist terrain blending. Q3map2 tries to remove a seams on the connected terrain blend materials; this is done by forcing both material (eg. forcing per-vertex alpha component) to show the same texture at connection point. In order to do that, q3map2 need to know what texture is used in background and foreground layer of a material. Supplied indexes gives that info. All textures that is used for terrain blending should be indexed (eg terrain/grass is 1, terrain/ground is 2, terrain/rock is 3). For grass-ground blend - q3map_alphaLayer 1 2, for ground-rock blend - q3map_alphaLayers 2 3 etc.

====q3map_noVertexLight====
:Material with this keyword will skip vertex light calculations entirely. This keyword should be in material if vertex RGBA data is used for some effect.

====q3map_vertexPointSample====
:[[vertex lighting | Vertex lighting]] of a surface will be calculated using lightgrid's ''LightContributionToPoint'' function (instead of default ''LightContributionToSample'' which works for lightmaps).

===Area lights===

====q3map_sunExt &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt; &lt;intensity&gt; &lt;degrees&gt; &lt;elevation&gt; &lt;deviance&gt; &lt;samples&gt;&lt;/nowiki&gt;====
:This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase. Parameters are:
:* '''r g b''' - Color of light. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.
:* '''intensity''' - The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.
:* '''degrees''' - The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south.
:* '''elevation ''' - The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.
:* '''deviance''' - The number of degrees for penumbra (half-shadow). General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree. This gives you much more realistic shadows from the sun.
:* '''samples''' - The number of random jitters distributed over the solid arc (16 is a good value).
:{{design|Sky shaders should probably still have a q3map_skyLight value. The sun gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows.}}

====q3map_skyLight &lt;nowiki&gt;&lt;amount&gt; &lt;iterations&gt;&lt;/nowiki&gt;====
:Make surface to cast light. Amount is a brightness value, similar to what you would use in '''q3map_sunExt'''. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful.

====q3map_lightImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:The keyword q3map_lightImage generates lighting from the average color of the TGA image specified by the q3map_lightimage.
:The keyword sequence for generating light on a q3map_skyLight should be ordered as follows:
:# q3map_lightImage (the texture providing the light and the color of the light)
:# qer_editorImage (the editor-only image used to select the source map for the texture)
:# the average color of the light emitted from the shader is calculated from the lightimage.

====q3map_lightRGB &lt;nowiki&gt;&lt;r&gt; &lt;g&gt; &lt;b&gt;&lt;/nowiki&gt;====
:This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters.
:{{tip|This does not affect bounced light in radiosity or lightfilter}}

====q3map_lightmapSampleOffset &lt;nowiki&gt;&lt;distance&gt;&lt;/nowiki&gt;====
:Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting splotches on lightmapped terrain.

====q3map_lightmapFilterRadius&lt;nowiki&gt;&lt;self&gt; &lt;other&gt;&lt;/nowiki&gt;====
:This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources. The self parameter can be set for skyLights for finer subdivided lighting, but should be set to 0 for sky shaders since they don't have lightmaps. The other parameter should be set just high enough to eliminate the &quot;stadium shadow&quot; effect sometimes produced by q3map_skyLight. If using a value higher than 4 for the iterations parameter on q3map_skyLight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. 
:{{tip|q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect}}

===Lighting tweaks===

====q3map_nonplanar====
:Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders. This improves lightmapping of a curved brush faces covered by this material.

====q3map_lightmapMergable====
:Allows terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity.

====q3map_forceMeta====
:Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per material basis. This is required for lightmapped models.
:{{tip|forceMeta is also applied by '''Lightmapped''' flag on misc_models}}

====q3map_shadeAngle &lt;nowiki&gt;&lt;angle&gt;&lt;/nowiki&gt;====
:Specifies the breaking angle for smooth shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.
:{{tip|This keyword only affects light calculations, not real surface normals}}

====q3map_lightmapSampleSize &lt;nowiki&gt;&lt;N&gt;&lt;/nowiki&gt;====
:Surfaces using a material with this keyword will have the pixel size of the lightmaps set to (NxN). This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required. The default lightmap sample size is 16 (can be overriden using -samplesize key of q3map2 light phase).

====q3map_bounceScale &lt;nowiki&gt;&lt;value&gt;&lt;/nowiki&gt;====
:Use a number between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything, per se, but it does give you finer control over how each shader re-emits light. Default bounce scale is 0.25.

====q3map_normalImage &lt;nowiki&gt;&lt;texturePath&gt;&lt;/nowiki&gt;====
:Specifies [[normalmap]] image to be used for calculating lightmap intensities. This will, effectively, bake normalmap-caused shading into lightmap.

==Editor Specific Keywords==

These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.

===qer_editorImage &lt;nowiki&gt;&lt;textureName&gt;&lt;/nowiki&gt;===
:This keyword makes level editor to display different texture in 3D viewport.
:The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
:Later, Q3map2 will use this texture to generate texture coordinates on [[brush | brushes]].
:'''Conventions''': All textures supplied for qer_editorImage should be stored in radiant/ folder (like '''radiant/textures/town/wall1_1''', '''radiant/models/mapobjects/crypt/statue1''' etc.)
:'''Design Notes''': It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.

===qer_trans &lt;nowiki&gt;&lt;N.N&gt;&lt;/nowiki&gt;===
:This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.

===qer_alphaFunc &lt;nowiki&gt;&lt;func&gt; &lt;N.N&gt;&lt;/nowiki&gt;===
:If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too. 
:Functions are:
:* '''greater''' - greater than
:* '''gequal''' - greater or equal
:* '''lesser''' - lesser than
:* '''lequal''' - lesser or equal
:* '''equal''' - equal

{{navigation footer|Stages}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces material system/Stages</title>
    <ns>0</ns>
    <id>134</id>
      <sha1>8bezh7w9zj4dgeh9tzia6jafl7qj2i0</sha1>
    <revision>
      <id>1664</id>
      <timestamp>2012-07-23T09:42:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Darkplaces material system|Stages|p=Special Keywords|n=}} == Base Stage == === Texture Map === Specifies the base texture map (a 24 or 32-bit TGA or JPEG fi...&quot;</comment>
      <text xml:space="preserve" bytes="11417">{{navigation title|Darkplaces material system|Stages|p=Special Keywords|n=}}
== Base Stage ==
=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1678</id>
      <timestamp>2012-07-23T09:49:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11395">{{navigation title|Darkplaces material system|Stages}}
== Base Stage ==
=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.

When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.

'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1725</id>
      <timestamp>2012-07-23T12:11:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11396">{{navigation title|Darkplaces material system|Stages}}
== Base Stage ==
=== Texture Map ===
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

=== Blend Function ===
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

=== alphaGen vertex ===

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

=== tcGen environment ===
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

=== tcMod &amp;lt;function&amp;gt; ===
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

'''tcMod rotate &amp;lt;degrees/sec&amp;gt;'''
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

'''tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt;'''
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

'''tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt;'''
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

'''tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt;'''
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

'''tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt;'''
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

'''tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt;'''
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

'''tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt;'''
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1726</id>
      <timestamp>2012-07-23T12:12:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11383">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1727</id>
      <timestamp>2012-07-23T12:13:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Map */</comment>
      <text xml:space="preserve" bytes="11409">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
{{hidden begin | Example}}
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.
{{hidden end}}

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1728</id>
      <timestamp>2012-07-23T12:14:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Map */</comment>
      <text xml:space="preserve" bytes="11383">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

'''map &amp;lt;textureName&amp;gt;'''
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

'''clampMap &amp;lt;textureName&amp;gt;'''
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

'''animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt;'''
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1729</id>
      <timestamp>2012-07-23T12:14:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Texture Map */</comment>
      <text xml:space="preserve" bytes="11389">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
'''Design note''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1730</id>
      <timestamp>2012-07-23T12:14:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Texture Map */</comment>
      <text xml:space="preserve" bytes="11391">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* '''frequency''' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* '''texture1...texture64''': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1731</id>
      <timestamp>2012-07-23T12:15:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11387">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

'''blendFunc blend'''
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc add'''
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

'''blendFunc addalpha'''
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

'''blendFunc filter'''
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

'''blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;'''
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1732</id>
      <timestamp>2012-07-23T12:15:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blend Function */</comment>
      <text xml:space="preserve" bytes="11397">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
:Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
:When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
:'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1733</id>
      <timestamp>2012-07-23T12:16:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* tcMod &amp;lt;function&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11394">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1734</id>
      <timestamp>2012-07-23T12:16:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11397">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).
:* '''base''' : Undefined.
:* '''amplitude''' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* '''phase''' : See the explanation for phase under the deformVertexes keyword.
:* '''freq''' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>1735</id>
      <timestamp>2012-07-23T12:17:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11389">{{navigation title|Darkplaces material system|Stages}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }</text>
    </revision>
    <revision>
      <id>2082</id>
      <timestamp>2012-07-27T19:22:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11396">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2287</id>
      <timestamp>2012-07-30T21:45:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11409">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[bmodel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2325</id>
      <timestamp>2012-07-30T22:01:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="11409">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2651</id>
      <timestamp>2012-09-16T16:30:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11458">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 tcMod stretch sin 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2652</id>
      <timestamp>2012-09-16T16:32:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11600">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 &lt;font color=green&gt;// stretch coordinates using sin wave with 1.5 seconds cycle time&lt;/font&gt;
 &lt;font color=blue&gt;tcMod stretch&lt;/font&gt; &lt;font color=orange&gt;sin&lt;/font&gt; 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2795</id>
      <timestamp>2012-11-15T07:32:59Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11600">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 &lt;font color=green&gt;// stretch coordinates using sin wave with 1.5 seconds cycle time&lt;/font&gt;
 &lt;font color=blue&gt;tcMod stretch&lt;/font&gt; &lt;font color=orange&gt;sin&lt;/font&gt; 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + s * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2797</id>
      <timestamp>2012-11-15T07:36:31Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11600">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 &lt;font color=green&gt;// stretch coordinates using sin wave with 1.5 seconds cycle time&lt;/font&gt;
 &lt;font color=blue&gt;tcMod stretch&lt;/font&gt; &lt;font color=orange&gt;sin&lt;/font&gt; 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2798</id>
      <timestamp>2012-11-15T07:44:27Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11908">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 &lt;font color=green&gt;// stretch coordinates using sin wave with 1.5 seconds cycle time&lt;/font&gt;
 &lt;font color=blue&gt;tcMod stretch&lt;/font&gt; &lt;font color=orange&gt;sin&lt;/font&gt; 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers.
'''Example''':
 &lt;span style=&quot;color:green&quot;&gt;// Transform that does nothing&lt;/span&gt;
 &lt;span style=&quot;color:blue&quot;&gt;tcMod&lt;/span&gt; transform 1 0 0 1 0 1
 &lt;span style=&quot;color:green&quot;&gt;// Shift texture T coordinate (usually up) by 1/128 of its size&lt;/span&gt;
 &lt;span style=&quot;color:blue&quot;&gt;tcMod&lt;/span&gt; transform 1 0 0 1 0 0.0078125

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2799</id>
      <timestamp>2012-11-15T07:45:42Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11953">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 &lt;font color=green&gt;// stretch coordinates using sin wave with 1.5 seconds cycle time&lt;/font&gt;
 &lt;font color=blue&gt;tcMod stretch&lt;/font&gt; &lt;font color=orange&gt;sin&lt;/font&gt; 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers. S stands for side coordinate (width), T stands for Top (height).
'''Example''':
 &lt;span style=&quot;color:green&quot;&gt;// Transform that does nothing&lt;/span&gt;
 &lt;span style=&quot;color:blue&quot;&gt;tcMod&lt;/span&gt; transform 1 0 0 1 0 1
 &lt;span style=&quot;color:green&quot;&gt;// Shift texture up by 1/128 of it's height&lt;/span&gt;
 &lt;span style=&quot;color:blue&quot;&gt;tcMod&lt;/span&gt; transform 1 0 0 1 0 0.0078125

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2800</id>
      <timestamp>2012-11-15T08:16:14Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; */</comment>
      <text xml:space="preserve" bytes="11953">{{navigation title|Special Keywords}}
== Texture Map ==
Specifies the base texture map (a 24 or 32-bit TGA or JPEG file) used for this material. 

=== map &amp;lt;textureName&amp;gt; ===
:The texture may or may not contain alpha channel information. Texture name can have no extension as engine will automatically add it. For texture/blah, darkplaces will search for this textures:
:* dds/texture/blah.dds
:* texture/blah.tga
:* texture/blah.png
:* texture/blah.jpeg

=== clampMap &amp;lt;textureName&amp;gt; ===
:Specifies the source texture map (see map). Clamping keeps texture from tiling (texture coordinates is clamped to 0-1).
:'''Design notes''': level editor doesnt show clampMap properly, moreover [[brush | brushes]] use texture projection which is converted to real texture coordinates when map is compiled. To bypass that limitation use &quot;Fit&quot; instrument in surface/patch inspector as it always make 0-1-compliant texture projection.

=== animMap &amp;lt;frequency&amp;gt; &amp;lt;texture1&amp;gt; ... &amp;lt;texture64&amp;gt; ===
:The surfaces in the game can be animated by displaying a sequence of 1 to 64 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.
:* ''frequency'' : The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.
:* ''texture1...texture64'': the texture path/texture name for each animation frame must be explicitly listed. Up to 64 frames (64 separate texture files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.
:If you want to clamp texture coordinates such as in '''clampMap''', put '''animClampMap''' instead of '''animMap'''.
:'''Example''':
 &lt;font color=green&gt;// A 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds.&lt;/font&gt;
 &lt;font color=green&gt;// Each frame would be displayed for 1 second before the next one is displayed.&lt;/font&gt;
 &lt;font color=green&gt;// The cycle repeats after the last frame in sequence shown.&lt;/font&gt;
 &lt;font color=blue&gt;animMap&lt;/font&gt; 0.25 '''models/fx/flame1 models/fx/flame2 models/fx/flame3 models/fx/flame4'''
:'''Design Notes''': To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.

== Blend Function ==
Blend functions are the keyword commands that tell engine's renderer how material will be mixed with objects that is behind it.

The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.

=== blendFunc blend ===
:Traditional alpha blending (shorthand command for ''blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc add ===
:Additive blending  (shorthand command for ''blendFunc GL_ONE GL_ONE'').

=== blendFunc addalpha ===
:Additive blending with alpha (shorthand command for ''blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA'').

=== blendFunc filter ===
:A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters. Shorthand command that can be substituted for either ''blendFunc GL_DST_COLOR GL_ZERO'' or ''blendFunc GL_ZERO GL_SRC_COLOR'').

=== blendFunc &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt; ===
:Alternative, GL-friendly blending mode definition. Source is pixel of texture. Destination is pixel in framebuffer. Possible codes for source and destination:
:* GL_ONE
:* GL_ZERO
:* GL_SRC_COLOR
:* GL_SRC_ALPHA
:* GL_DST_COLOR
:* GL_DST_ALPHA
:* GL_ONE_MINUS_SRC_COLOR
:* GL_ONE_MINUS_SRC_ALPHA
:* GL_ONE_MINUS_DST_COLOR
:* GL_ONE_MINUS_DST_ALPHA

== alphaGen vertex ==

Enables vertex-controlled transparency. Reguires per-vertex rgba attributes which is supported on [[BModel | submodels]].

[[ASE]] format used by [[misc_model]] (and converted to map geometry during compile) supports per-vertex transparency. 

Other model formats such as [[MD3]], [[DPM]], [[IQM]] does not support per-vertex rgba attributes, hence cannot have per-vertex transparency.

== tcGen environment ==
Generate spherical environment-mapped texture coordinates. Used for fake gloss effect.

== tcMod &amp;lt;function&amp;gt; ==
Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are ''rotate'', ''scale'', ''scroll'', ''stretch'', ''transform'', ''turb'' and ''page''. Up to 4 tcMod's are allowed.
When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified.
'''Example''':
 &lt;font color=green&gt;// texture coordinates will be scaled then scrolled.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 0.5
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 1 1

=== tcMod rotate &amp;lt;degrees/sec&amp;gt; ===
:This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example ''tcMod rotate 5'' would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).

=== tcMod scale &amp;lt;sScale&amp;gt; &amp;lt;tScale&amp;gt; ===
:Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture.
:'''Example''': 
 &lt;font color=green&gt;// repeat twice along texture width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scale&lt;/font&gt; 0.5 2

=== tcMod scroll &amp;lt;sSpeed&amp;gt; &amp;lt;tSpeed&amp;gt; ===
:Scrolls the texture coordinates with the given speeds. The values &quot;s&quot; and &quot;t&quot; conform to the &quot;x&quot; and &quot;y&quot; values (respectively) as they are found in the original texture file. The scroll speed is measured in &quot;textures&quot; per second. A &quot;texture&quot; is the dimension of the texture being modified and includes any previous material modifications to the original texture file). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.
:'''Example''': 
 &lt;font color=green&gt;// Moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod scroll&lt;/font&gt; 0.5 -0.5
:'''IMPORTANT NOTE''': This should be the last tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some materials.

=== tcMod stretch &amp;lt;func&amp;gt; &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;frequency&amp;gt; ===
:Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Key Concepts for waveform parameter definitions).
:'''Example''':
 &lt;font color=green&gt;// stretch coordinates using sin wave with 1.5 seconds cycle time&lt;/font&gt;
 &lt;font color=blue&gt;tcMod stretch&lt;/font&gt; &lt;font color=orange&gt;sin&lt;/font&gt; 1.2 0.8 0 1.5

=== tcMod transform &amp;lt;m00&amp;gt; &amp;lt;m01&amp;gt; &amp;lt;m10&amp;gt; &amp;lt;m11&amp;gt; &amp;lt;t0&amp;gt; &amp;lt;t1&amp;gt; ===
:Transforms each texture coordinate as follows:
:S = s * m00 + t * m10 + t0
:T = s * m01 + t * m11 + t1
:This is for use by programmers. S stands for side coordinate (width), T stands for top (height).
'''Example''':
 &lt;span style=&quot;color:green&quot;&gt;// Transform that does nothing&lt;/span&gt;
 &lt;span style=&quot;color:blue&quot;&gt;tcMod&lt;/span&gt; transform 1 0 0 1 0 1
 &lt;span style=&quot;color:green&quot;&gt;// Shift texture up by 1/128 of it's height&lt;/span&gt;
 &lt;span style=&quot;color:blue&quot;&gt;tcMod&lt;/span&gt; transform 1 0 0 1 0 0.0078125

=== tcMod turb &amp;lt;base&amp;gt; &amp;lt;amplitude&amp;gt; &amp;lt;phase&amp;gt; &amp;lt;freq&amp;gt; ===
:Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.
:* ''base'' : Undefined.
:* ''amplitude'' : This is essentially the intensity of the disturbance or twisting and squiggling of the texture.
:* ''phase'' : See the explanation for phase under the deformVertexes keyword.
:* ''freq'' : Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.
:'''IMPORTANT NOTE''': This should be first tcMod in a stage because it is only software tcMod (all other ones transform texture matrix).

=== tcMod page &amp;lt;width&amp;gt; &amp;lt;height&amp;gt; &amp;lt;delay&amp;gt; ===
:Texture animation using texture coordinates shifting. Require all animations to be stored in single texture in the form of tiles.
:The texture is shifted by 1/&lt;width&gt; every &lt;delay&gt; seconds, and by 1/&lt;height&gt; every &lt;delay&gt;*&lt;width&gt; seconds.
:'''Example''':
 &lt;font color=green&gt;// To use that animation, make a texture with the frames aligned in a grid like this:&lt;/font&gt;
 &lt;font color=green&gt;//    1   2   3   4&lt;/font&gt;
 &lt;font color=green&gt;//    5   6   7   8&lt;/font&gt;
 &lt;font color=green&gt;// Then align it in on the model/brush/curve so only one of the animation frames can be seen on the surface.&lt;/font&gt;
 &lt;font color=green&gt;// Engine will then display the frames in order and the cycle will repeat every 0.8 seconds.&lt;/font&gt;
 &lt;font color=blue&gt;tcMod page&lt;/font &gt; 4 2 0.1

== Lightmap Stage ==

This stage tells renderer to show material with static lighting ([[lightmap]], [[vertex lighting]] or [[lightgrid]]) applied. It have no parameters and must always be the last stage.

'''Example''':

 '''models/mapobjects/cave/crystal01'''
 {
     &lt;font color=blue&gt;dpglossintensitymod&lt;/font&gt; 0.5
     &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.2
     &lt;font color=blue&gt;dpmeshcollisions&lt;/font&gt;
     &lt;font color=blue&gt;dpreflectcube&lt;/font&gt; '''textures/envmaps/crystal01_'''
     &lt;font color=blue&gt;dpnoshadow&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''models/mapobjects/cave/crystal01'''
     }
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     {
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

== Terrain Blending Stage ==

For terrain blending to be used on material, additional stage that represents second texture (foreground layer) for terrain blending should be added.

Example:

 '''textures/terraintest'''
 { 
     &lt;font color=blue&gt;qer_editorimage&lt;/font&gt; '''radiant/textures/terraintest'''
 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; stone
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; detail 
     &lt;font color=blue&gt;surfaceparm&lt;/font&gt; trans 
     &lt;font color=green&gt;// base stage - background texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/grass'''
     } 
     &lt;font color=green&gt;// terrain blending stage - foreground texture&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''textures/terrain/rock'''
         &lt;font color=blue&gt;blendFunc blend&lt;/font&gt;
         &lt;font color=blue&gt;alphaFunc GE128&lt;/font&gt; &lt;font color=green&gt;// optional parm and enables additional alpha-splatting effect to be used in blending algorithm&lt;/font&gt;
         &lt;font color=blue&gt;alphaGen vertex&lt;/font&gt;
     } 
     &lt;font color=green&gt;// lightmap stage&lt;/font&gt;
     { 
         &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
     }
 }

{{navigation footer|}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Darkplaces virtual file system</title>
    <ns>0</ns>
    <id>49</id>
      <sha1>bmt8yez017xihzgiibf5448muifd0il</sha1>
    <revision>
      <id>410</id>
      <timestamp>2012-07-12T15:18:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Darkplaces virtual file system is file table that combines real file system and files stored in game archives.  The goals it provides:   * opaque access to separate gamedir st...&quot;</comment>
      <text xml:space="preserve" bytes="742">Darkplaces virtual file system is file table that combines real file system and files stored in game archives.

The goals it provides:
 
* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, and its own files)
* safety (gamecode cannot damage game files)

= How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed</text>
    </revision>
    <revision>
      <id>411</id>
      <timestamp>2012-07-12T15:19:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="743">Darkplaces virtual file system is file table that combines real file system and files stored in game archives.

The goals it provides:
 
* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, and its own files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed</text>
    </revision>
    <revision>
      <id>412</id>
      <timestamp>2012-07-12T15:19:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="739">Darkplaces virtual file system is file table that combines real file system and files stored in game archives.

The goals it provides:
 
* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed</text>
    </revision>
    <revision>
      <id>413</id>
      <timestamp>2012-07-12T15:29:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1702">Darkplaces virtual file system is file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than basedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc. So if you write, for examplem foo.txt (which will be written to data/foo.txt) and have foo.txt in basedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in basedir.

=== 3. &quot;.&quot; and &quot;..&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.</text>
    </revision>
    <revision>
      <id>414</id>
      <timestamp>2012-07-12T15:31:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1705">Darkplaces virtual file system is file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.</text>
    </revision>
    <revision>
      <id>415</id>
      <timestamp>2012-07-12T15:31:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1716">Darkplaces virtual file system is file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

__NOTOC__</text>
    </revision>
    <revision>
      <id>416</id>
      <timestamp>2012-07-12T15:32:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1724">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

__NOTOC__</text>
    </revision>
    <revision>
      <id>417</id>
      <timestamp>2012-07-12T15:36:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1950">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

= Launch keys =

Heres is the some engine interna

__NOTOC__</text>
    </revision>
    <revision>
      <id>418</id>
      <timestamp>2012-07-12T15:45:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2318">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

= Launch keys =

{| width=500 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=20% | Key
! width=80% | Description
|-
| align=center | -nohome
| Disables homedir support, all use files will be written to gamedir (a must-have option for using internal editors).
|-
| align=center | -game
| Sets new gamedir (for mods).
|-
| align=center | -basedir
| Sets new basedir (a first gamedir).
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>419</id>
      <timestamp>2012-07-12T15:45:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1899">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

__NOTOC__</text>
    </revision>
    <revision>
      <id>451</id>
      <timestamp>2012-07-14T20:51:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1926">[[File:PageOutdated.png]]

Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

__NOTOC__</text>
    </revision>
    <revision>
      <id>452</id>
      <timestamp>2012-07-14T20:51:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1899">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

__NOTOC__</text>
    </revision>
    <revision>
      <id>716</id>
      <timestamp>2012-07-15T02:19:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1931">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

= How file table is maked =

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

= Quirks =

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1054</id>
      <timestamp>2012-07-17T20:39:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1935">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1055</id>
      <timestamp>2012-07-17T20:39:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1933">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

==How file table is maked==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1056</id>
      <timestamp>2012-07-17T20:39:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1935">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1318</id>
      <timestamp>2012-07-20T10:48:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Virtual file system]] to [[Darkplaces virtual file system]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="1935">Darkplaces virtual file system is overlay file table that combines real file system and files stored in game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1321</id>
      <timestamp>2012-07-20T10:50:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1955">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is no allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1329</id>
      <timestamp>2012-07-20T11:00:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Quirks */</comment>
      <text xml:space="preserve" bytes="1956">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, system automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is not allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1739</id>
      <timestamp>2012-07-24T05:06:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1956">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

=== 1. Homedir may be different than gamedir ===

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

=== 2. For written files, &quot;data/&quot; are automatically added ===

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

=== 3. &quot;./&quot; and &quot;../&quot; is not allowed ===

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

=== 4. Not fully integrated with map editor ===

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1856</id>
      <timestamp>2012-07-26T16:38:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1955">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2212</id>
      <timestamp>2012-07-30T07:44:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1968">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* opaque access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2449</id>
      <timestamp>2012-08-03T13:33:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>fix a typo</comment>
      <text xml:space="preserve" bytes="1973">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* transparent access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; directory operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2450</id>
      <timestamp>2012-08-03T13:35:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* 3. &quot;./&quot; and &quot;../&quot; is not allowed */</comment>
      <text xml:space="preserve" bytes="1968">Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* transparent access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; path operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2898</id>
      <timestamp>2012-11-23T01:13:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1971">{{TOCRIGHT}}
Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* transparent access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foot.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; path operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3333</id>
      <timestamp>2012-12-13T11:10:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* 2. For written files, &quot;data/&quot; are automatically added */</comment>
      <text xml:space="preserve" bytes="1970">{{TOCRIGHT}}
Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* transparent access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foo.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; path operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files.

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3335</id>
      <timestamp>2012-12-13T11:33:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* 4. Not fully integrated with map editor */</comment>
      <text xml:space="preserve" bytes="2208">{{TOCRIGHT}}
Darkplaces virtual file system is overlay file table that combines real file system and files stored in [[PK3]] and [[PAK]] game archives.

The goals it provides:

* transparent access to separate gamedir storing all writeable files (My Documents/My Games)
* access files in archives just like they were stored on HDD
* mod support (mods can override files, add new files)
* safety (gamecode cannot damage game files)

== How file table is maked ==

# First gamedir is processed
## Archives processed sequentally (by alphabetical order), files with same name gets overlapped
## Files with empty contents overlapping other files, makes them 'deleted' to the file system
## Real files stored in gamedir is processed and overlap files in archives
# Next gamedir is processed

== Quirks ==

Since virtual file system is, effectively, an abstraction layer, it has its own quirks.

====1. Homedir may be different than gamedir====

This means config.cfg, screenshots etc. are stored in different directory, like in &quot;My Documents/My Games/gamedir&quot;

====2. For written files, &quot;data/&quot; are automatically added====

When QC writes any files, engine automatically adds 'data/' to the path, so gamecode cannot damage game files, maps etc. But file read is not the same. It could read files from base directory, open maps etc.

So if you write, for example, foo.txt (which will be written to data/foo.txt) and have foo.txt in gamedir, you should set path &quot;data/foo.txt&quot; when reading the file, and set path &quot;foo.txt&quot; when writing. If you dont, you will write to file under &quot;data/&quot;, but read file that is in gamedir.

====3. &quot;./&quot; and &quot;../&quot; is not allowed====

To protect gamecode from damaging files, any use of &quot;.&quot; and &quot;..&quot; path operators is forbidden.

====4. Not fully integrated with map editor====

Map editor do not support Virtual File System in model selection dialogue (entity inspector), it only can select real files. This is not a problem with developed version of Blood Omnicide (SVN working copy with test installation), but release verson SDK should make sure all game models is unpacked in order to make editor see them in model selection dialog box.

[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Diffuse</title>
    <ns>0</ns>
    <id>225</id>
      <sha1>7tfv5gqqcaelidq9oa5y2r3k6njwz1p</sha1>
    <revision>
      <id>2465</id>
      <timestamp>2012-08-03T18:35:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{grammar}} [[File:Color_vs_diffuse.jpg|thumb|512px|Color texture (on the left) and diffuse texture]] Diffuse texture - a version of color texture applicable to Phong shading....&quot;</comment>
      <text xml:space="preserve" bytes="933">{{grammar}}
[[File:Color_vs_diffuse.jpg|thumb|512px|Color texture (on the left) and diffuse texture]]
Diffuse texture - a version of color texture applicable to Phong shading. Usually color texture contains shadowing and specular applied - info that is not required for Phong shading as shadowing and specular are done during rendering (using [[normalmap]] and [[specular | specular map]]).

In Darkplaces, there is no special texture slot for a diffuse, it is replacing color texture. So it matters how your surface world be lit (with phong shading or just with [[lightmap]]) to determine, if should draw a diffuse texture or generic color texture.

Lighting up a non-diffuse texture with Phong shading will decrease an effect of realtime per-pixel lighting, as both calculated and baked shades will appear.

{{tip|Blood Omnicide using Phong shading on all surfaces.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2466</id>
      <timestamp>2012-08-03T18:37:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="923">{{grammar}}
[[File:Color_vs_diffuse.jpg|thumb|512px|Color texture (on the left) and diffuse texture]]
Diffuse texture - a version of color texture applicable to Phong shading. Usually color texture contains shadowing and specular applied - info that is not required for Phong shading as it have shading and specular done during rendering (using [[normalmap]] and [[specular | specular map]]).

In Darkplaces, there is no special texture slot for a diffuse, it is replacing color texture. So it matters how your surface world be lit (with phong shading or just with [[lightmap]]) to determine, if should draw a diffuse texture or generic color texture.

{{important|Lighting up a non-diffuse texture with Phong shading will decrease an effect of it, as both calculated and baked shades will appear.}}
{{tip|Blood Omnicide using Phong shading on all surfaces.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2467</id>
      <timestamp>2012-08-03T18:38:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="923">{{grammar}}
[[File:Color_vs_diffuse.jpg|thumb|400px|Color texture (on the left) and diffuse texture]]
Diffuse texture - a version of color texture applicable to Phong shading. Usually color texture contains shadowing and specular applied - info that is not required for Phong shading as it have shading and specular done during rendering (using [[normalmap]] and [[specular | specular map]]).

In Darkplaces, there is no special texture slot for a diffuse, it is replacing color texture. So it matters how your surface world be lit (with phong shading or just with [[lightmap]]) to determine, if should draw a diffuse texture or generic color texture.

{{important|Lighting up a non-diffuse texture with Phong shading will decrease an effect of it, as both calculated and baked shades will appear.}}
{{tip|Blood Omnicide using Phong shading on all surfaces.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2468</id>
      <timestamp>2012-08-03T18:38:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="936">{{grammar}}
[[File:Color_vs_diffuse.jpg|thumb|400px|Color texture (on the left) and diffuse texture]]
Diffuse texture - a version of color texture applicable to Phong shading. Usually color texture contains shadowing and specular applied - info that is not required for Phong shading as it have shading and specular done during rendering (using [[normalmap]] and [[specular | specular map]]).

In Darkplaces, there is no special texture slot for a diffuse, it is replacing color texture. So it matters how your surface world be lit (with phong shading or just with [[lightmap]]) to determine, if should draw a diffuse texture or generic color texture.

{{important|Lighting up a non-diffuse texture with Phong shading will decrease an effect of it, as both calculated and baked shades will appear.}}
{{tip|Blood Omnicide using Phong shading on all surfaces.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2711</id>
      <timestamp>2012-09-28T13:49:07Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="952">{{grammar checked|darth}}
[[File:Color_vs_diffuse.jpg|thumb|400px|Color texture (on the left) and diffuse texture]]
Diffuse texture - a version of color texture applicable to Phong shading. Usually color texture contains shadowing and specular applied - info that is not required for Phong shading as it has shading and specular done during rendering (using [[normalmap]] and [[specular | specular map]]).

In Darkplaces, there is no special texture slot for a diffuse, it is a replacing color texture. So it matters how your surface world be lit (with phong shading or just with [[lightmap]]) to determine, if should draw a diffuse texture or a generic color texture.

{{important|Lighting up a non-diffuse texture with Phong shading will decrease an effect of it, as both calculated and baked shades will appear.}}
{{tip|Blood Omnicide uses Phong shading on all surfaces.}}

[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Entity</title>
    <ns>0</ns>
    <id>13</id>
      <sha1>6kyiiaqt1bi17agedb6lx2yqqe7yi8h</sha1>
    <revision>
      <id>103</id>
      <timestamp>2012-07-02T18:42:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Entity (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.  In Blood Omnicide, each entity have entity number (index in global entity stora...&quot;</comment>
      <text xml:space="preserve" bytes="678">Entity (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fields. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client endity (exist on a client)
* Menu entity (exists in menu which is a separate program because client program get unloaded when level changes)</text>
    </revision>
    <revision>
      <id>104</id>
      <timestamp>2012-07-02T18:43:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="721">Entity (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fields. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client endity (exist on a client)
* Menu entity (exists in menu which is a separate program because client program get unloaded when level changes)

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>105</id>
      <timestamp>2012-07-02T18:45:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="939">Entity (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client entity (exist on a client)
* Menu entity (exists in menu program which is a separated from a client because client program get unloaded when level changes)

Theres is also special entity types managed by Darkplaces Engine:

* Network Entity - legacy networking (not using client side progs)
* Render Entity - a Network/Client entity that is sent to render.

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>106</id>
      <timestamp>2012-07-02T18:45:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="945">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client entity (exist on a client)
* Menu entity (exists in menu program which is a separated from a client because client program get unloaded when level changes)

Theres is also special entity types managed by Darkplaces Engine:

* Network Entity - legacy networking (not using client side progs)
* Render Entity - a Network/Client entity that is sent to render.

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>107</id>
      <timestamp>2012-07-02T18:46:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="946">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client entity (exists on a client)
* Menu entity (exists in menu program which is a separated from a client because client program get unloaded when level changes)

Theres is also special entity types managed by Darkplaces Engine:

* Network Entity - legacy networking (not using client side progs)
* Render Entity - a Network/Client entity that is sent to render.

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>108</id>
      <timestamp>2012-07-02T18:46:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="946">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client entity (exists on a client)
* Menu entity (exists on menu program which is a separated from a client because client program get unloaded when level changes)

Theres is also special entity types managed by Darkplaces Engine:

* Network Entity - legacy networking (not using client side progs)
* Render Entity - a Network/Client entity that is sent to render.

[[Category: General Editing Terminology]]</text>
    </revision>
    <revision>
      <id>431</id>
      <timestamp>2012-07-14T19:47:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="926">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

There is 3 types of entities in the game code, depends on what programs they exists:

* Game entity (exists on server)
* Client entity (exists on a client)
* Menu entity (exists on menu program which is a separated from a client because client program get unloaded when level changes)

Theres is also special entity types managed by Darkplaces Engine:

* Network Entity - legacy networking (not using client side progs)
* Render Entity - a Network/Client entity that is sent to render.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1408</id>
      <timestamp>2012-07-22T19:22:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1516">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

=== Entity types ===

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* entity class (code-drived behavior)
* fields (or keys) - entity properties.

Example of entity fields:
 health - health of entity
 classname - entity class name
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1409</id>
      <timestamp>2012-07-22T19:22:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1494">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* entity class (code-drived behavior)
* fields (or keys) - entity properties.

Example of entity fields:
 health - health of entity
 classname - entity class name
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1410</id>
      <timestamp>2012-07-22T19:22:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1494">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* entity class (code-driven behavior)
* fields (or keys) - entity properties.

Example of entity fields:
 health - health of entity
 classname - entity class name
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1411</id>
      <timestamp>2012-07-22T19:23:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1500">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* fields (or keys) - all entity properties.

Entity behavior is set by it's fields.

Example of entity fields:
 health - health of entity
 classname - entity class name
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1412</id>
      <timestamp>2012-07-22T19:24:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1573">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* fields (or keys) - all entity properties.

Entity behavior is set by it's fields.

Example of entity fields:
 health - health of entity
 classname - entity class name
 th_die - internal game field, a game function to call when monster dies
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1413</id>
      <timestamp>2012-07-22T19:24:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Game entity structure */</comment>
      <text xml:space="preserve" bytes="1577">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* fields (or keys) - all entity properties.

Entity behavior is defined by it's fields.

Example of entity fields:
 health - health of entity
 classname - entity class name
 th_die - internal game field, a game function to call when monster dies
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1414</id>
      <timestamp>2012-07-22T19:26:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1744">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* fields (or keys) - all entity properties.

Entity behavior is defined by it's fields.

Example of entity fields:
 origin - position or entity in the world space
 health - health of entity
 classname - entity class name
 th_die - internal game field, a game function to call when monster dies
 _next - system field used by entity chain routines
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not acessible in level editor ('''th_die''' is an example)
* Non-Saved field - not saved to a savegame field, this fields always prefixed by _ ('''_next''' field).
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map ('''_ls''' field).

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1415</id>
      <timestamp>2012-07-22T19:26:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Fields classification */</comment>
      <text xml:space="preserve" bytes="1745">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

There is 3 types of game entities, depends on what programs they exists:

* Game entity
** Server entity (actual game entity, get saved to savegames)
** Client entity (networked game entity on a client)
** Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Network entity - legacy engine-based networking (not using client-side progs)
* Render entity - a Network/Client entity that is sent to render.

=== Game entity structure ===

Each game entity have:
* entity number (index in global entity storage)
* fields (or keys) - all entity properties.

Entity behavior is defined by it's fields.

Example of entity fields:
 origin - position or entity in the world space
 health - health of entity
 classname - entity class name
 th_die - internal game field, a game function to call when monster dies
 _next - system field used by entity chain routines
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.

==== Fields classification ====

* Common field - field of entity that can be set in level editor (such as '''origin''')
* Gamecode field - this one is being set by gamecode, not accessible in level editor ('''th_die''' is an example)
* Non-Saved field - not saved to a savegame field, this fields always prefixed by _ ('''_next''' field).
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map ('''_ls''' field).

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2662</id>
      <timestamp>2012-09-25T12:38:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1979">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

== Game entity ==

Each game entity have unique number (a position in entities array) and set of fields. Set of fields are shared between all entities, but their usage is based on entity class and subclass functions.  It means if &quot;health&quot; field is defined, any entity can access it, but based on entity class, it can have different meaning. There is system fields used by engine routines (spawnflags, movetype).

Entity fields can be one of 5 types:
* float - 32bit float value
* vector - 3-dimensional vector (3 floats)
* entity - pointer to another entity (really integer number)
* string - pointer to a string (strings are stored in special memory zones - constant strings, temp strings, zoned strings).
* function - funtion pointer

Depending of engine build, strings could be from 1024(game build) to 16384 (developer build) characters long. Max entities is also 2048 in game build and 128k in development build.

When game is saved engine writes all entity keys except ones prefixed with ''_''. This fields are meant to be runtime-only.

Example of entity fields:
 origin - position or entity in the world space
 health - health of monster/trigger
 classname - entity class name (a function called after entity get spawned)
 th_die - internal game field, a game function to call when monster dies
 _next - system field used by entity chain routines
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

=== Other entities ===
Game entity represents server entity - entity spawned and processed on server programs. There are more entitity types created and processed in other programs:

* Client entity (networked game entity on a client)
* Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Render entity - entity that is sent to render.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2663</id>
      <timestamp>2012-09-25T12:39:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1977">'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

== Game entity ==

Each game entity have unique number (a position in entities array) and set of fields. Set of fields are shared between all entities, but their usage is based on entity class and subclass functions.  It means if &quot;health&quot; field is defined, any entity can access it, but based on entity class, it can have different meaning. There is system fields used by engine routines (spawnflags, movetype).

Entity fields can be one of 5 types:
* float - 32bit float value
* vector - 3-dimensional vector (3 floats)
* entity - pointer to another entity (really integer number)
* string - pointer to a string (strings are stored in special memory zones - constant strings, temp strings, zoned strings).
* function - funtion pointer

Depending of engine build, strings could be from 1024(game build) to 16384 (developer build) characters long. Max entities is also 2048 in game build and 128k in development build.

When game is saved engine writes all entity keys except ones prefixed with ''_''. This fields are meant to be runtime-only.

Example of entity fields:
 origin - position or entity in the world space
 health - health of monster/trigger
 classname - entity class name (a function called after entity get spawned)
 th_die - internal game field, a game function to call when monster dies
 _next - system field used by entity chain routines
 _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

== Other entities ==
Game entity represents server entity - entity spawned and processed on server programs. There are more entitity types created and processed in other programs:

* Client entity (networked game entity on a client)
* Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
* Render entity - entity that is sent to render.

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>Entity classes</title>
    <ns>0</ns>
    <id>23</id>
      <sha1>e85r697n3s497vi7sswuctgksm4m61j</sha1>
    <revision>
      <id>302</id>
      <timestamp>2012-07-03T19:01:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Misc == [[misc_gamemodel]]  == Items == [[item_flay]]&quot;</comment>
      <text xml:space="preserve" bytes="56">== Misc ==
[[misc_gamemodel]]

== Items ==
[[item_flay]]</text>
    </revision>
    <revision>
      <id>338</id>
      <timestamp>2012-07-03T22:33:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="178">== Misc ==
[[misc_gamemodel]]

== Items ==
[[item_heart]]
[[item_flay]]
[[item_implode]]
[[item_pentalich]]
[[item_antitoxin]]
[[item_slowtime]]
[[item_font]]
[[item_energybank]]</text>
    </revision>
    <revision>
      <id>339</id>
      <timestamp>2012-07-03T22:33:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="194">== Misc ==
[[misc_gamemodel]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]</text>
    </revision>
    <revision>
      <id>344</id>
      <timestamp>2012-07-03T22:35:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Misc */</comment>
      <text xml:space="preserve" bytes="196">== Misc ==
* [[misc_gamemodel]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]</text>
    </revision>
    <revision>
      <id>394</id>
      <timestamp>2012-07-12T11:46:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="546">== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event]]</text>
    </revision>
    <revision>
      <id>395</id>
      <timestamp>2012-07-12T11:48:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="673">== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event]]</text>
    </revision>
    <revision>
      <id>400</id>
      <timestamp>2012-07-12T11:51:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="700">== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]</text>
    </revision>
    <revision>
      <id>420</id>
      <timestamp>2012-07-12T15:46:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="711">== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>696</id>
      <timestamp>2012-07-15T02:07:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="735">{{article unfinished}}

== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>2001</id>
      <timestamp>2012-07-27T14:01:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="727">{{unfinished}}

== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>3692</id>
      <timestamp>2014-05-15T20:33:29Z</timestamp>
      <contributor>
        <ip>95.31.46.12</ip>
      </contributor>
      <text xml:space="preserve" bytes="951">{{unfinished}}
== Archetypes ==
Entity archetypes are defined in gamecode. It sets a common behavior of an entity class. A typical archetypes are: Monsters, Items, Spots, Triggerw etc.
* [[item(entity)|Item]]
* [[monster(entity)|Monster]]

== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>3693</id>
      <timestamp>2014-05-15T20:34:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Archetypes */</comment>
      <text xml:space="preserve" bytes="951">{{unfinished}}
== Archetypes ==
Entity archetypes are defined in gamecode. It sets a common behavior of an entity class. A typical archetypes are: Monsters, Items, Spots, Triggerw etc.
* [[Item|item(entity)]]
* [[Monster|monster(entity)]]

== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>3694</id>
      <timestamp>2014-05-15T20:35:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="951">{{unfinished}}
== Archetypes ==
Entity archetypes are defined in gamecode. It sets a common behavior of an entity class. A typical archetypes are: Monsters, Items, Spots, Triggerw etc.
* [[item(entity)|Item]]
* [[monster(entity)|Monster]]

== Misc ==
* [[misc_gamemodel]]
* [[info_teleport_destination]]

== Submodels ==
* [[func_gamemodel]]
* [[func_train]]
* [[func_group]]
* [[func_wall]]
* [[func_roof]]
* [[func_areadisable]]

== Items ==
* [[item_heart]]
* [[item_flay]]
* [[item_implode]]
* [[item_pentalich]]
* [[item_antitoxin]]
* [[item_slowtime]]
* [[item_font]]
* [[item_energybank]]

== Triggers ==
* [[trigger_multi]]
* [[trigger_once]]
* [[trigger_secret]]
* [[trigger_redirect]]
* [[trigger_counter]]
* [[trigger_puzzle]]
* [[trigger_changelevel]]
* [[trigger_teleport]]
* [[trigger_savegame]]

== Zones ==
* [[zone_slick]]
* [[zone_spikes]]
* [[zone_exit]]
* [[zone_environment]]
* [[zone_event(entity class) | zone_event]]

__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>File:3dsmaxaseimporter.png</title>
    <ns>6</ns>
    <id>281</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2811</id>
      <timestamp>2012-11-21T20:38:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Adam brown kain iron armor.jpg</title>
    <ns>6</ns>
    <id>432</id>
      <sha1>0b44vbmtlnp9h6ttkltvt802mikf6me</sha1>
    <revision>
      <id>3115</id>
      <timestamp>2012-11-30T09:45:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Adam Brown]]</comment>
      <text xml:space="preserve" bytes="55">[[Category:Concept art]]
[[Category:Art by Adam Brown]]</text>
    </revision>
  </page>
  <page>
    <title>File:Adam brown kain wraith armor.png</title>
    <ns>6</ns>
    <id>433</id>
      <sha1>0b44vbmtlnp9h6ttkltvt802mikf6me</sha1>
    <revision>
      <id>3116</id>
      <timestamp>2012-11-30T09:45:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Adam Brown]]</comment>
      <text xml:space="preserve" bytes="55">[[Category:Concept art]]
[[Category:Art by Adam Brown]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred anacrothe.jpg</title>
    <ns>6</ns>
    <id>362</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3044</id>
      <timestamp>2012-11-30T09:02:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred brigand with mace and other things.png</title>
    <ns>6</ns>
    <id>365</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3047</id>
      <timestamp>2012-11-30T09:03:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred brigand with mace.png</title>
    <ns>6</ns>
    <id>364</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3046</id>
      <timestamp>2012-11-30T09:02:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred brigand.png</title>
    <ns>6</ns>
    <id>363</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3045</id>
      <timestamp>2012-11-30T09:02:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred cave wolf.jpg</title>
    <ns>6</ns>
    <id>366</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3048</id>
      <timestamp>2012-11-30T09:03:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred demon cathedral.png</title>
    <ns>6</ns>
    <id>367</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3049</id>
      <timestamp>2012-11-30T09:03:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred gypsy rogue.png</title>
    <ns>6</ns>
    <id>368</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3050</id>
      <timestamp>2012-11-30T09:03:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred gypsy.png</title>
    <ns>6</ns>
    <id>369</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3051</id>
      <timestamp>2012-11-30T09:03:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred manslug.png</title>
    <ns>6</ns>
    <id>370</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3052</id>
      <timestamp>2012-11-30T09:03:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred mausoleum.png</title>
    <ns>6</ns>
    <id>371</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3053</id>
      <timestamp>2012-11-30T09:04:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred rogue mercenarie.png</title>
    <ns>6</ns>
    <id>372</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3054</id>
      <timestamp>2012-11-30T09:04:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred sagdool.jpg</title>
    <ns>6</ns>
    <id>373</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3055</id>
      <timestamp>2012-11-30T09:04:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred sawtooth.png</title>
    <ns>6</ns>
    <id>374</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3056</id>
      <timestamp>2012-11-30T09:04:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred skull waterfall.jpg</title>
    <ns>6</ns>
    <id>375</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3057</id>
      <timestamp>2012-11-30T09:04:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:Amddred vampire hunter.png</title>
    <ns>6</ns>
    <id>376</id>
      <sha1>994hgnqqnj45kvmph2hdt1uhg6x4bjl</sha1>
    <revision>
      <id>3058</id>
      <timestamp>2012-11-30T09:04:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by AmDDRed]]</comment>
      <text xml:space="preserve" bytes="52">[[Category:Concept art]]
[[Category:Art by AmDDRed]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-Circle-of-Nine.jpg</title>
    <ns>6</ns>
    <id>396</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3079</id>
      <timestamp>2012-11-30T09:25:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC02.jpg</title>
    <ns>6</ns>
    <id>398</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3081</id>
      <timestamp>2012-11-30T09:26:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC03.jpg</title>
    <ns>6</ns>
    <id>399</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3082</id>
      <timestamp>2012-11-30T09:26:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC04.jpg</title>
    <ns>6</ns>
    <id>400</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3083</id>
      <timestamp>2012-11-30T09:26:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC05.jpg</title>
    <ns>6</ns>
    <id>401</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3084</id>
      <timestamp>2012-11-30T09:26:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC06.jpg</title>
    <ns>6</ns>
    <id>402</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3085</id>
      <timestamp>2012-11-30T09:26:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC07.jpg</title>
    <ns>6</ns>
    <id>403</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3086</id>
      <timestamp>2012-11-30T09:26:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC08.jpg</title>
    <ns>6</ns>
    <id>404</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3087</id>
      <timestamp>2012-11-30T09:26:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC11.jpg</title>
    <ns>6</ns>
    <id>405</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3088</id>
      <timestamp>2012-11-30T09:27:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC12.jpg</title>
    <ns>6</ns>
    <id>406</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3089</id>
      <timestamp>2012-11-30T09:27:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-DC13.jpg</title>
    <ns>6</ns>
    <id>407</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3090</id>
      <timestamp>2012-11-30T09:27:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-Def000584.JPG</title>
    <ns>6</ns>
    <id>408</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3091</id>
      <timestamp>2012-11-30T09:27:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-Def000599.JPG</title>
    <ns>6</ns>
    <id>410</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3093</id>
      <timestamp>2012-11-30T09:27:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-Def000609.JPG</title>
    <ns>6</ns>
    <id>411</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3094</id>
      <timestamp>2012-11-30T09:27:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-MutantConcept2.JPG</title>
    <ns>6</ns>
    <id>419</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3102</id>
      <timestamp>2012-11-30T09:28:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-Oracle'sChamberConcept2.JPG</title>
    <ns>6</ns>
    <id>420</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3103</id>
      <timestamp>2012-11-30T09:29:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-PiperConcept2.JPG</title>
    <ns>6</ns>
    <id>421</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3104</id>
      <timestamp>2012-11-30T09:29:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-SkeletConcept2.JPG</title>
    <ns>6</ns>
    <id>422</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3105</id>
      <timestamp>2012-11-30T09:29:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-UndeadConcept2.JPG</title>
    <ns>6</ns>
    <id>423</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3106</id>
      <timestamp>2012-11-30T09:29:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:BO-Concept-Art-WolfConcept.JPG</title>
    <ns>6</ns>
    <id>579</id>
      <sha1>457nk1sqnwu1uzoe2je95le159mq7ad</sha1>
    <revision>
      <id>3280</id>
      <timestamp>2012-11-30T13:06:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Blood Omen concept art]]</comment>
      <text xml:space="preserve" bytes="60">[[Category:Concept art]]
[[Category:Blood Omen concept art]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bloodpill.gif</title>
    <ns>6</ns>
    <id>284</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2815</id>
      <timestamp>2012-11-22T05:07:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bloodpill.png</title>
    <ns>6</ns>
    <id>285</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2816</id>
      <timestamp>2012-11-22T05:08:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bloodpillsprites.jpg</title>
    <ns>6</ns>
    <id>293</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2824</id>
      <timestamp>2012-11-22T05:26:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bloodpillsprites2.jpg</title>
    <ns>6</ns>
    <id>294</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2825</id>
      <timestamp>2012-11-22T05:27:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bloodpilltiles.jpg</title>
    <ns>6</ns>
    <id>292</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2823</id>
      <timestamp>2012-11-22T05:26:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bo boss anacrothe cutscene.gif</title>
    <ns>6</ns>
    <id>436</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3128</id>
      <timestamp>2012-11-30T10:41:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss ariel.gif</title>
    <ns>6</ns>
    <id>437</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3129</id>
      <timestamp>2012-11-30T10:41:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss azimuth.gif</title>
    <ns>6</ns>
    <id>438</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3130</id>
      <timestamp>2012-11-30T10:41:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss bane cutscene.gif</title>
    <ns>6</ns>
    <id>440</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3132</id>
      <timestamp>2012-11-30T10:41:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss bane.gif</title>
    <ns>6</ns>
    <id>439</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3131</id>
      <timestamp>2012-11-30T10:41:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss dejoule cutscene.gif</title>
    <ns>6</ns>
    <id>442</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3134</id>
      <timestamp>2012-11-30T10:42:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss dejoule.gif</title>
    <ns>6</ns>
    <id>441</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3133</id>
      <timestamp>2012-11-30T10:42:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss elzevir.gif</title>
    <ns>6</ns>
    <id>443</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3135</id>
      <timestamp>2012-11-30T10:42:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss hashakgik.gif</title>
    <ns>6</ns>
    <id>444</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3136</id>
      <timestamp>2012-11-30T10:42:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss kain.gif</title>
    <ns>6</ns>
    <id>445</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3137</id>
      <timestamp>2012-11-30T10:42:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss malek.gif</title>
    <ns>6</ns>
    <id>446</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3138</id>
      <timestamp>2012-11-30T10:43:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss mobius.gif</title>
    <ns>6</ns>
    <id>447</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3139</id>
      <timestamp>2012-11-30T10:43:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss mortanius.gif</title>
    <ns>6</ns>
    <id>448</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3140</id>
      <timestamp>2012-11-30T10:43:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss nemesis.gif</title>
    <ns>6</ns>
    <id>449</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3141</id>
      <timestamp>2012-11-30T10:43:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss nupraptor.gif</title>
    <ns>6</ns>
    <id>450</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3142</id>
      <timestamp>2012-11-30T10:43:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss ottmar.gif</title>
    <ns>6</ns>
    <id>451</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3143</id>
      <timestamp>2012-11-30T10:43:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo boss vorador.gif</title>
    <ns>6</ns>
    <id>452</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3144</id>
      <timestamp>2012-11-30T10:43:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo captive female1.gif</title>
    <ns>6</ns>
    <id>453</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3145</id>
      <timestamp>2012-11-30T10:43:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo captive female2.gif</title>
    <ns>6</ns>
    <id>454</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3146</id>
      <timestamp>2012-11-30T10:44:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo captive male1.gif</title>
    <ns>6</ns>
    <id>455</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3147</id>
      <timestamp>2012-11-30T10:44:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo captive male2.gif</title>
    <ns>6</ns>
    <id>456</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3148</id>
      <timestamp>2012-11-30T10:44:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo captive male3.gif</title>
    <ns>6</ns>
    <id>457</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3149</id>
      <timestamp>2012-11-30T10:44:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand gypsy.gif</title>
    <ns>6</ns>
    <id>458</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3151</id>
      <timestamp>2012-11-30T10:44:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand mace.gif</title>
    <ns>6</ns>
    <id>459</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3152</id>
      <timestamp>2012-11-30T10:45:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand macemerc.gif</title>
    <ns>6</ns>
    <id>460</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3153</id>
      <timestamp>2012-11-30T10:45:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand merc.gif</title>
    <ns>6</ns>
    <id>461</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3154</id>
      <timestamp>2012-11-30T10:45:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand rogue.gif</title>
    <ns>6</ns>
    <id>462</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3155</id>
      <timestamp>2012-11-30T10:45:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand roguemerc.gif</title>
    <ns>6</ns>
    <id>463</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3156</id>
      <timestamp>2012-11-30T10:45:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy brigand.gif</title>
    <ns>6</ns>
    <id>314</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2934</id>
      <timestamp>2012-11-28T18:55:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>3150</id>
      <timestamp>2012-11-30T10:44:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Bo enemy brigand.gif]]&amp;quot;: [[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bo enemy cave abomination.gif</title>
    <ns>6</ns>
    <id>319</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2959</id>
      <timestamp>2012-11-29T21:32:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>3126</id>
      <timestamp>2012-11-30T10:40:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="39">[[CCategory:Blood Omen enemy pictures]]</text>
    </revision>
    <revision>
      <id>3127</id>
      <timestamp>2012-11-30T10:40:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy cave purplewolf.gif</title>
    <ns>6</ns>
    <id>464</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3157</id>
      <timestamp>2012-11-30T10:45:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy cave wolf.gif</title>
    <ns>6</ns>
    <id>465</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3158</id>
      <timestamp>2012-11-30T10:46:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy cultist aver.gif</title>
    <ns>6</ns>
    <id>467</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3160</id>
      <timestamp>2012-11-30T10:46:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy cultist.gif</title>
    <ns>6</ns>
    <id>466</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3159</id>
      <timestamp>2012-11-30T10:46:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy demon gray.gif</title>
    <ns>6</ns>
    <id>468</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3161</id>
      <timestamp>2012-11-30T10:46:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy demon green.gif</title>
    <ns>6</ns>
    <id>469</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3162</id>
      <timestamp>2012-11-30T10:46:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy demon purple.gif</title>
    <ns>6</ns>
    <id>470</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3163</id>
      <timestamp>2012-11-30T10:46:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy demon red.gif</title>
    <ns>6</ns>
    <id>471</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3164</id>
      <timestamp>2012-11-30T10:46:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy dog.gif</title>
    <ns>6</ns>
    <id>472</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3165</id>
      <timestamp>2012-11-30T10:47:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy ghast.gif</title>
    <ns>6</ns>
    <id>473</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3166</id>
      <timestamp>2012-11-30T10:47:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy ghost.gif</title>
    <ns>6</ns>
    <id>474</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3167</id>
      <timestamp>2012-11-30T10:47:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy ghoul.gif</title>
    <ns>6</ns>
    <id>475</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3168</id>
      <timestamp>2012-11-30T10:47:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gog black.gif</title>
    <ns>6</ns>
    <id>477</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3170</id>
      <timestamp>2012-11-30T10:50:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gog summoner.gif</title>
    <ns>6</ns>
    <id>478</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3171</id>
      <timestamp>2012-11-30T10:50:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gog.gif</title>
    <ns>6</ns>
    <id>476</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3169</id>
      <timestamp>2012-11-30T10:47:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gravedigger.gif</title>
    <ns>6</ns>
    <id>479</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3172</id>
      <timestamp>2012-11-30T10:50:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsy dagger.gif</title>
    <ns>6</ns>
    <id>481</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3174</id>
      <timestamp>2012-11-30T10:51:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsy knife.gif</title>
    <ns>6</ns>
    <id>482</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3175</id>
      <timestamp>2012-11-30T10:51:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsy.gif</title>
    <ns>6</ns>
    <id>480</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3173</id>
      <timestamp>2012-11-30T10:51:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsyman1.gif</title>
    <ns>6</ns>
    <id>483</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3176</id>
      <timestamp>2012-11-30T10:51:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsyman2.gif</title>
    <ns>6</ns>
    <id>484</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3177</id>
      <timestamp>2012-11-30T10:51:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsyman3.gif</title>
    <ns>6</ns>
    <id>485</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3178</id>
      <timestamp>2012-11-30T10:51:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy gypsyman4.gif</title>
    <ns>6</ns>
    <id>486</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3179</id>
      <timestamp>2012-11-30T10:51:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy hellhound.gif</title>
    <ns>6</ns>
    <id>487</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3180</id>
      <timestamp>2012-11-30T10:51:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy insectbeast.gif</title>
    <ns>6</ns>
    <id>488</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3181</id>
      <timestamp>2012-11-30T10:52:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy irmok.gif</title>
    <ns>6</ns>
    <id>489</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3182</id>
      <timestamp>2012-11-30T10:52:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy manslug.gif</title>
    <ns>6</ns>
    <id>490</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3183</id>
      <timestamp>2012-11-30T10:52:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy miner.gif</title>
    <ns>6</ns>
    <id>491</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3184</id>
      <timestamp>2012-11-30T10:52:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy murderer.gif</title>
    <ns>6</ns>
    <id>492</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3185</id>
      <timestamp>2012-11-30T10:52:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis combo.gif</title>
    <ns>6</ns>
    <id>494</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3187</id>
      <timestamp>2012-11-30T10:52:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis combo2.gif</title>
    <ns>6</ns>
    <id>493</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3186</id>
      <timestamp>2012-11-30T10:52:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis dagger.gif</title>
    <ns>6</ns>
    <id>495</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3188</id>
      <timestamp>2012-11-30T10:52:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis falshion.gif</title>
    <ns>6</ns>
    <id>496</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3189</id>
      <timestamp>2012-11-30T10:53:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis flamberge.gif</title>
    <ns>6</ns>
    <id>497</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3190</id>
      <timestamp>2012-11-30T10:53:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis guard.gif</title>
    <ns>6</ns>
    <id>498</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3191</id>
      <timestamp>2012-11-30T10:53:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis hatchetcomb.gif</title>
    <ns>6</ns>
    <id>499</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3192</id>
      <timestamp>2012-11-30T10:53:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis mace.gif</title>
    <ns>6</ns>
    <id>500</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3193</id>
      <timestamp>2012-11-30T10:53:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy nemesis standardbearer.gif</title>
    <ns>6</ns>
    <id>502</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3195</id>
      <timestamp>2012-11-30T10:53:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy pulsemonster.gif</title>
    <ns>6</ns>
    <id>503</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3196</id>
      <timestamp>2012-11-30T10:54:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy redsphere.gif</title>
    <ns>6</ns>
    <id>504</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3197</id>
      <timestamp>2012-11-30T10:54:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy sagdoll lh.gif</title>
    <ns>6</ns>
    <id>506</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3199</id>
      <timestamp>2012-11-30T10:54:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy sagdoll needler.gif</title>
    <ns>6</ns>
    <id>507</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3200</id>
      <timestamp>2012-11-30T10:54:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy sagdoll.gif</title>
    <ns>6</ns>
    <id>505</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3198</id>
      <timestamp>2012-11-30T10:54:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy sawtooth.gif</title>
    <ns>6</ns>
    <id>508</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3201</id>
      <timestamp>2012-11-30T10:55:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy scarecrow.gif</title>
    <ns>6</ns>
    <id>509</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3202</id>
      <timestamp>2012-11-30T10:55:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy shadow.gif</title>
    <ns>6</ns>
    <id>510</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3203</id>
      <timestamp>2012-11-30T10:55:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy shadowsummoner.gif</title>
    <ns>6</ns>
    <id>511</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3204</id>
      <timestamp>2012-11-30T10:55:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy shadowwarrior axe.gif</title>
    <ns>6</ns>
    <id>513</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3206</id>
      <timestamp>2012-11-30T10:56:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy shadowwarrior katana.gif</title>
    <ns>6</ns>
    <id>514</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3207</id>
      <timestamp>2012-11-30T10:56:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy shadowwarrior.gif</title>
    <ns>6</ns>
    <id>512</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3205</id>
      <timestamp>2012-11-30T10:55:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton axe.gif</title>
    <ns>6</ns>
    <id>516</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3209</id>
      <timestamp>2012-11-30T10:56:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton falshion.gif</title>
    <ns>6</ns>
    <id>517</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3210</id>
      <timestamp>2012-11-30T10:56:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton red.gif</title>
    <ns>6</ns>
    <id>518</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3211</id>
      <timestamp>2012-11-30T10:56:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton redaxe.gif</title>
    <ns>6</ns>
    <id>519</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3212</id>
      <timestamp>2012-11-30T10:56:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton redfalshion.gif</title>
    <ns>6</ns>
    <id>520</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>3213</id>
      <timestamp>2012-11-30T10:57:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton trap.gif</title>
    <ns>6</ns>
    <id>521</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3214</id>
      <timestamp>2012-11-30T10:57:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton wraith.gif</title>
    <ns>6</ns>
    <id>522</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3215</id>
      <timestamp>2012-11-30T10:57:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy skeleton.gif</title>
    <ns>6</ns>
    <id>515</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3208</id>
      <timestamp>2012-11-30T10:56:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy slime.gif</title>
    <ns>6</ns>
    <id>523</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3216</id>
      <timestamp>2012-11-30T10:57:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy slimedrop blue.gif</title>
    <ns>6</ns>
    <id>524</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3217</id>
      <timestamp>2012-11-30T10:57:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy slimedrop green.gif</title>
    <ns>6</ns>
    <id>525</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3218</id>
      <timestamp>2012-11-30T10:57:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy soultorturer.gif</title>
    <ns>6</ns>
    <id>526</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3219</id>
      <timestamp>2012-11-30T10:57:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy soultrapper.gif</title>
    <ns>6</ns>
    <id>527</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3220</id>
      <timestamp>2012-11-30T10:57:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy spikedorb red.gif</title>
    <ns>6</ns>
    <id>529</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3222</id>
      <timestamp>2012-11-30T10:58:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy spikedorb.gif</title>
    <ns>6</ns>
    <id>528</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3221</id>
      <timestamp>2012-11-30T10:58:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy spikeplant.gif</title>
    <ns>6</ns>
    <id>530</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3223</id>
      <timestamp>2012-11-30T10:58:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy tarslime.gif</title>
    <ns>6</ns>
    <id>531</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3224</id>
      <timestamp>2012-11-30T10:58:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
    <revision>
      <id>3225</id>
      <timestamp>2012-11-30T10:58:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Bo enemy tarslime.gif]]&amp;quot;: [[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy teddybear.gif</title>
    <ns>6</ns>
    <id>532</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3226</id>
      <timestamp>2012-11-30T10:58:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townguard aver.gif</title>
    <ns>6</ns>
    <id>534</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3228</id>
      <timestamp>2012-11-30T11:00:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townguard averaxe.gif</title>
    <ns>6</ns>
    <id>535</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3229</id>
      <timestamp>2012-11-30T11:00:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townguard axe.gif</title>
    <ns>6</ns>
    <id>536</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3230</id>
      <timestamp>2012-11-30T11:00:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townguard shield.gif</title>
    <ns>6</ns>
    <id>537</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3231</id>
      <timestamp>2012-11-30T11:00:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townguard.gif</title>
    <ns>6</ns>
    <id>533</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>3227</id>
      <timestamp>2012-11-30T11:00:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman butcher.gif</title>
    <ns>6</ns>
    <id>554</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3248</id>
      <timestamp>2012-11-30T11:02:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman innkeeper.gif</title>
    <ns>6</ns>
    <id>555</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3249</id>
      <timestamp>2012-11-30T11:03:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman maidservant.gif</title>
    <ns>6</ns>
    <id>556</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3250</id>
      <timestamp>2012-11-30T11:03:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman peasant.gif</title>
    <ns>6</ns>
    <id>557</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3251</id>
      <timestamp>2012-11-30T11:03:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman smith.gif</title>
    <ns>6</ns>
    <id>558</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3252</id>
      <timestamp>2012-11-30T11:04:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman wench.gif</title>
    <ns>6</ns>
    <id>559</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3253</id>
      <timestamp>2012-11-30T11:04:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman1.gif</title>
    <ns>6</ns>
    <id>538</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3232</id>
      <timestamp>2012-11-30T11:00:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman10.gif</title>
    <ns>6</ns>
    <id>547</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3241</id>
      <timestamp>2012-11-30T11:01:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman11.gif</title>
    <ns>6</ns>
    <id>548</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3242</id>
      <timestamp>2012-11-30T11:01:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman12.gif</title>
    <ns>6</ns>
    <id>549</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3243</id>
      <timestamp>2012-11-30T11:02:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman13.gif</title>
    <ns>6</ns>
    <id>550</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3244</id>
      <timestamp>2012-11-30T11:02:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman14.gif</title>
    <ns>6</ns>
    <id>551</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3245</id>
      <timestamp>2012-11-30T11:02:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman15.gif</title>
    <ns>6</ns>
    <id>552</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3246</id>
      <timestamp>2012-11-30T11:02:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman16.gif</title>
    <ns>6</ns>
    <id>553</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3247</id>
      <timestamp>2012-11-30T11:02:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman2.gif</title>
    <ns>6</ns>
    <id>539</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3233</id>
      <timestamp>2012-11-30T11:00:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman3.gif</title>
    <ns>6</ns>
    <id>540</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3234</id>
      <timestamp>2012-11-30T11:01:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman4.gif</title>
    <ns>6</ns>
    <id>541</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3235</id>
      <timestamp>2012-11-30T11:01:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman5.gif</title>
    <ns>6</ns>
    <id>542</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3236</id>
      <timestamp>2012-11-30T11:01:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman6.gif</title>
    <ns>6</ns>
    <id>543</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3237</id>
      <timestamp>2012-11-30T11:01:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman7.gif</title>
    <ns>6</ns>
    <id>544</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3238</id>
      <timestamp>2012-11-30T11:01:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman8.gif</title>
    <ns>6</ns>
    <id>545</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3239</id>
      <timestamp>2012-11-30T11:01:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy townsman9.gif</title>
    <ns>6</ns>
    <id>546</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3240</id>
      <timestamp>2012-11-30T11:01:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy toxicplant.gif</title>
    <ns>6</ns>
    <id>560</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3254</id>
      <timestamp>2012-11-30T11:04:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampire bride.gif</title>
    <ns>6</ns>
    <id>561</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3255</id>
      <timestamp>2012-11-30T11:04:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampire mist.gif</title>
    <ns>6</ns>
    <id>562</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3256</id>
      <timestamp>2012-11-30T11:04:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampire werewolf.gif</title>
    <ns>6</ns>
    <id>563</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3257</id>
      <timestamp>2012-11-30T11:04:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampire witch.gif</title>
    <ns>6</ns>
    <id>564</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3258</id>
      <timestamp>2012-11-30T11:04:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampirehunter spear.gif</title>
    <ns>6</ns>
    <id>566</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3260</id>
      <timestamp>2012-11-30T11:05:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampirehunter torch.gif</title>
    <ns>6</ns>
    <id>567</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3261</id>
      <timestamp>2012-11-30T11:05:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampirehunter whip.gif</title>
    <ns>6</ns>
    <id>568</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3262</id>
      <timestamp>2012-11-30T11:05:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampirehunter.gif</title>
    <ns>6</ns>
    <id>565</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3259</id>
      <timestamp>2012-11-30T11:05:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy vampirehuntress.gif</title>
    <ns>6</ns>
    <id>569</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3263</id>
      <timestamp>2012-11-30T11:06:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf kingguard.gif</title>
    <ns>6</ns>
    <id>570</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3264</id>
      <timestamp>2012-11-30T11:06:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf standardbearer.gif</title>
    <ns>6</ns>
    <id>571</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3265</id>
      <timestamp>2012-11-30T11:06:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf townguard mace.gif</title>
    <ns>6</ns>
    <id>573</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3267</id>
      <timestamp>2012-11-30T11:06:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf townguard.gif</title>
    <ns>6</ns>
    <id>572</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3266</id>
      <timestamp>2012-11-30T11:06:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf warrior bigsword.gif</title>
    <ns>6</ns>
    <id>575</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3269</id>
      <timestamp>2012-11-30T11:06:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf warrior mace.gif</title>
    <ns>6</ns>
    <id>576</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3270</id>
      <timestamp>2012-11-30T11:06:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willendorf warrior.gif</title>
    <ns>6</ns>
    <id>574</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3268</id>
      <timestamp>2012-11-30T11:06:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy willowisp.gif</title>
    <ns>6</ns>
    <id>577</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3271</id>
      <timestamp>2012-11-30T11:06:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bo enemy wolf.gif</title>
    <ns>6</ns>
    <id>578</id>
      <sha1>c02wcaqo1hvf5sj0g89f7suqsrqv4bd</sha1>
    <revision>
      <id>3272</id>
      <timestamp>2012-11-30T11:06:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Blood Omen enemy pictures]]</comment>
      <text xml:space="preserve" bytes="38">[[Category:Blood Omen enemy pictures]]</text>
    </revision>
  </page>
  <page>
    <title>File:Bomap1.jpg</title>
    <ns>6</ns>
    <id>295</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2826</id>
      <timestamp>2012-11-22T05:29:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap2.jpg</title>
    <ns>6</ns>
    <id>296</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2827</id>
      <timestamp>2012-11-22T06:15:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap3.jpg</title>
    <ns>6</ns>
    <id>297</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2828</id>
      <timestamp>2012-11-22T06:15:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap4.jpg</title>
    <ns>6</ns>
    <id>298</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2829</id>
      <timestamp>2012-11-22T06:19:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap5.jpg</title>
    <ns>6</ns>
    <id>299</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2830</id>
      <timestamp>2012-11-22T06:20:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap6.jpg</title>
    <ns>6</ns>
    <id>300</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2831</id>
      <timestamp>2012-11-22T06:20:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap7.jpg</title>
    <ns>6</ns>
    <id>301</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2832</id>
      <timestamp>2012-11-22T06:20:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bomap8.jpg</title>
    <ns>6</ns>
    <id>302</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2833</id>
      <timestamp>2012-11-22T06:20:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Brush rules.jpg</title>
    <ns>6</ns>
    <id>276</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2746</id>
      <timestamp>2012-10-08T13:02:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2747</id>
      <timestamp>2012-10-08T13:06:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Brush rules.jpg]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2770</id>
      <timestamp>2012-10-10T11:22:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Brush rules.jpg]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Bug.png</title>
    <ns>6</ns>
    <id>141</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1803</id>
      <timestamp>2012-07-26T13:15:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>1944</id>
      <timestamp>2012-07-27T10:42:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>2181</id>
      <timestamp>2012-07-29T21:01:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Color vs diffuse.jpg</title>
    <ns>6</ns>
    <id>224</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2459</id>
      <timestamp>2012-08-03T14:19:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common antiportal.jpg</title>
    <ns>6</ns>
    <id>117</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>935</id>
      <timestamp>2012-07-16T20:49:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common areadisable.jpg</title>
    <ns>6</ns>
    <id>93</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>908</id>
      <timestamp>2012-07-16T19:59:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common black.jpg</title>
    <ns>6</ns>
    <id>94</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>909</id>
      <timestamp>2012-07-16T20:00:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common blackshadow.jpg</title>
    <ns>6</ns>
    <id>95</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>910</id>
      <timestamp>2012-07-16T20:00:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common caulk.jpg</title>
    <ns>6</ns>
    <id>96</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>911</id>
      <timestamp>2012-07-16T20:00:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common clip.jpg</title>
    <ns>6</ns>
    <id>97</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>912</id>
      <timestamp>2012-07-16T20:00:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common collision.jpg</title>
    <ns>6</ns>
    <id>98</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>913</id>
      <timestamp>2012-07-16T20:00:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common dpshadow.jpg</title>
    <ns>6</ns>
    <id>99</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>914</id>
      <timestamp>2012-07-16T20:00:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common fullclip.jpg</title>
    <ns>6</ns>
    <id>100</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>915</id>
      <timestamp>2012-07-16T20:01:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common hint.jpg</title>
    <ns>6</ns>
    <id>101</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>916</id>
      <timestamp>2012-07-16T20:01:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common ilava.jpg</title>
    <ns>6</ns>
    <id>102</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>917</id>
      <timestamp>2012-07-16T20:01:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common islime.jpg</title>
    <ns>6</ns>
    <id>103</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>918</id>
      <timestamp>2012-07-16T20:01:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common iwater.jpg</title>
    <ns>6</ns>
    <id>104</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>919</id>
      <timestamp>2012-07-16T20:01:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common lightblock.jpg</title>
    <ns>6</ns>
    <id>105</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>920</id>
      <timestamp>2012-07-16T20:01:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common lightgrid.jpg</title>
    <ns>6</ns>
    <id>106</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>921</id>
      <timestamp>2012-07-16T20:01:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common lighthull.jpg</title>
    <ns>6</ns>
    <id>107</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>922</id>
      <timestamp>2012-07-16T20:01:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common mark.jpg</title>
    <ns>6</ns>
    <id>115</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>931</id>
      <timestamp>2012-07-16T20:07:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common monsterclip.jpg</title>
    <ns>6</ns>
    <id>108</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>923</id>
      <timestamp>2012-07-16T20:02:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common nodraw.jpg</title>
    <ns>6</ns>
    <id>109</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>924</id>
      <timestamp>2012-07-16T20:02:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common nodrop.jpg</title>
    <ns>6</ns>
    <id>110</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>925</id>
      <timestamp>2012-07-16T20:02:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common origin.jpg</title>
    <ns>6</ns>
    <id>111</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>926</id>
      <timestamp>2012-07-16T20:02:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common roof.jpg</title>
    <ns>6</ns>
    <id>112</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>927</id>
      <timestamp>2012-07-16T20:02:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common shadow.jpg</title>
    <ns>6</ns>
    <id>113</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>928</id>
      <timestamp>2012-07-16T20:02:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common skip.jpg</title>
    <ns>6</ns>
    <id>116</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>934</id>
      <timestamp>2012-07-16T20:48:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Common trigger.jpg</title>
    <ns>6</ns>
    <id>114</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>929</id>
      <timestamp>2012-07-16T20:02:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Cvar.png</title>
    <ns>6</ns>
    <id>155</id>
      <sha1>kmlqpu5tsyiwl6fbhvgzpfdwq99ucbh</sha1>
    <revision>
      <id>1937</id>
      <timestamp>2012-07-27T10:37:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Formatting templates]]</comment>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>1948</id>
      <timestamp>2012-07-27T10:44:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Cvar.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>2182</id>
      <timestamp>2012-07-29T21:01:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2477</id>
      <timestamp>2012-08-05T20:10:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Cvar.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces arcade quake.jpg</title>
    <ns>6</ns>
    <id>206</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2416</id>
      <timestamp>2012-08-03T08:48:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces blood omnicide.jpg</title>
    <ns>6</ns>
    <id>207</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2417</id>
      <timestamp>2012-08-03T08:49:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces custom1.jpg</title>
    <ns>6</ns>
    <id>208</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2418</id>
      <timestamp>2012-08-03T08:49:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces darsana.jpg</title>
    <ns>6</ns>
    <id>220</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2436</id>
      <timestamp>2012-08-03T11:25:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces e1m1 retextured.jpg</title>
    <ns>6</ns>
    <id>223</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2454</id>
      <timestamp>2012-08-03T13:54:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2455</id>
      <timestamp>2012-08-03T13:54:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[File:Darkplaces e1m1 retextures.jpg]] to [[File:Darkplaces e1m1 retextured.jpg]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces gl lightmaps 2.jpg</title>
    <ns>6</ns>
    <id>238</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2507</id>
      <timestamp>2012-08-09T07:07:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces honeycomb.jpg</title>
    <ns>6</ns>
    <id>218</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2430</id>
      <timestamp>2012-08-03T10:46:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces in the shadows.jpg</title>
    <ns>6</ns>
    <id>217</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2428</id>
      <timestamp>2012-08-03T10:07:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces lightexample bouncegrid.jpg</title>
    <ns>6</ns>
    <id>227</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2470</id>
      <timestamp>2012-08-05T17:47:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces lightexample flat.jpg</title>
    <ns>6</ns>
    <id>228</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2471</id>
      <timestamp>2012-08-05T17:48:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces lightexample shading.jpg</title>
    <ns>6</ns>
    <id>229</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2472</id>
      <timestamp>2012-08-05T17:49:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces lightexample shadows.jpg</title>
    <ns>6</ns>
    <id>230</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2473</id>
      <timestamp>2012-08-05T17:49:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces lightexample specular.jpg</title>
    <ns>6</ns>
    <id>231</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2474</id>
      <timestamp>2012-08-05T17:50:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces lighting visualized.jpg</title>
    <ns>6</ns>
    <id>226</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2469</id>
      <timestamp>2012-08-05T17:19:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces logo.png</title>
    <ns>6</ns>
    <id>222</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2441</id>
      <timestamp>2012-08-03T12:10:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2442</id>
      <timestamp>2012-08-03T12:13:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Darkplaces logo.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2443</id>
      <timestamp>2012-08-03T12:16:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Darkplaces logo.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2444</id>
      <timestamp>2012-08-03T12:16:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Darkplaces logo.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2448</id>
      <timestamp>2012-08-03T13:29:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Darkplaces logo.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces nexuiz.jpg</title>
    <ns>6</ns>
    <id>214</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2424</id>
      <timestamp>2012-08-03T09:11:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces quake.png</title>
    <ns>6</ns>
    <id>209</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2419</id>
      <timestamp>2012-08-03T08:50:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces retro blazer.jpg</title>
    <ns>6</ns>
    <id>210</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2420</id>
      <timestamp>2012-08-03T08:50:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces stealer guy.jpg</title>
    <ns>6</ns>
    <id>211</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2421</id>
      <timestamp>2012-08-03T08:50:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces steel storm.jpg</title>
    <ns>6</ns>
    <id>212</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2422</id>
      <timestamp>2012-08-03T08:50:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces the hunted.jpg</title>
    <ns>6</ns>
    <id>216</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2427</id>
      <timestamp>2012-08-03T10:06:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2429</id>
      <timestamp>2012-08-03T10:18:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[File:Darkplaces the hunted.JPG]] to [[File:Darkplaces the hunted.jpg]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces tomes of mephistopheles.jpg</title>
    <ns>6</ns>
    <id>219</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2435</id>
      <timestamp>2012-08-03T11:22:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces transfusion.jpg</title>
    <ns>6</ns>
    <id>213</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2423</id>
      <timestamp>2012-08-03T09:10:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces wraith.jpg</title>
    <ns>6</ns>
    <id>221</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2439</id>
      <timestamp>2012-08-03T11:48:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplaces xonotic.jpg</title>
    <ns>6</ns>
    <id>215</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2425</id>
      <timestamp>2012-08-03T09:11:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplacesmd3exporter.png</title>
    <ns>6</ns>
    <id>277</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2801</id>
      <timestamp>2012-11-21T19:33:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Darkplacesmd3exporter2.png</title>
    <ns>6</ns>
    <id>278</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2802</id>
      <timestamp>2012-11-21T19:52:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Designtip.png</title>
    <ns>6</ns>
    <id>149</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1827</id>
      <timestamp>2012-07-26T14:28:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Enigma Shadow.jpg</title>
    <ns>6</ns>
    <id>352</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3032</id>
      <timestamp>2012-11-30T08:21:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3302</id>
      <timestamp>2012-12-04T19:39:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma anacrothe.jpg</title>
    <ns>6</ns>
    <id>341</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3021</id>
      <timestamp>2012-11-30T08:19:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3292</id>
      <timestamp>2012-12-04T19:34:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma brigand2.jpg</title>
    <ns>6</ns>
    <id>342</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3022</id>
      <timestamp>2012-11-30T08:19:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3293</id>
      <timestamp>2012-12-04T19:34:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma cave-wolf-color.jpg</title>
    <ns>6</ns>
    <id>344</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3024</id>
      <timestamp>2012-11-30T08:19:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3294</id>
      <timestamp>2012-12-04T19:34:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma dog.png</title>
    <ns>6</ns>
    <id>345</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3025</id>
      <timestamp>2012-11-30T08:19:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3295</id>
      <timestamp>2012-12-04T19:36:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma gold lion.jpg</title>
    <ns>6</ns>
    <id>346</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3026</id>
      <timestamp>2012-11-30T08:19:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3296</id>
      <timestamp>2012-12-04T19:36:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma hash ak gik art hr.jpg</title>
    <ns>6</ns>
    <id>347</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3027</id>
      <timestamp>2012-11-30T08:20:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3297</id>
      <timestamp>2012-12-04T19:36:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma hedgenoks grvdigger.jpg</title>
    <ns>6</ns>
    <id>348</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3028</id>
      <timestamp>2012-11-30T08:20:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3298</id>
      <timestamp>2012-12-04T19:36:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma hellhound.jpg</title>
    <ns>6</ns>
    <id>349</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3029</id>
      <timestamp>2012-11-30T08:20:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3299</id>
      <timestamp>2012-12-04T19:36:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma insectbeast sketch.jpg</title>
    <ns>6</ns>
    <id>350</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3030</id>
      <timestamp>2012-11-30T08:20:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3300</id>
      <timestamp>2012-12-04T19:37:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma red demon.jpg</title>
    <ns>6</ns>
    <id>351</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3031</id>
      <timestamp>2012-11-30T08:21:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3303</id>
      <timestamp>2012-12-04T19:39:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma spike plant.jpg</title>
    <ns>6</ns>
    <id>353</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3033</id>
      <timestamp>2012-11-30T08:21:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3301</id>
      <timestamp>2012-12-04T19:39:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma teddy bear.jpg</title>
    <ns>6</ns>
    <id>354</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3034</id>
      <timestamp>2012-11-30T08:21:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3304</id>
      <timestamp>2012-12-04T19:40:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma towngirl1.jpg</title>
    <ns>6</ns>
    <id>355</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3035</id>
      <timestamp>2012-11-30T08:21:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3305</id>
      <timestamp>2012-12-04T19:40:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma townguy.jpg</title>
    <ns>6</ns>
    <id>356</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3036</id>
      <timestamp>2012-11-30T08:21:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3306</id>
      <timestamp>2012-12-04T19:40:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma townsman2.jpg</title>
    <ns>6</ns>
    <id>357</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3037</id>
      <timestamp>2012-11-30T08:21:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3307</id>
      <timestamp>2012-12-04T19:40:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma werewolf.jpg</title>
    <ns>6</ns>
    <id>358</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3038</id>
      <timestamp>2012-11-30T08:21:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3308</id>
      <timestamp>2012-12-04T19:42:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma will-o-wisp.jpg</title>
    <ns>6</ns>
    <id>359</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3039</id>
      <timestamp>2012-11-30T08:22:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3309</id>
      <timestamp>2012-12-04T19:42:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Enigma wolf.jpg</title>
    <ns>6</ns>
    <id>360</id>
      <sha1>4lr7l0lm87uzehakopxcz89x88p5cro</sha1>
    <revision>
      <id>3040</id>
      <timestamp>2012-11-30T08:22:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</comment>
      <text xml:space="preserve" bytes="64">[[Category:Concept art]]
[[Category:Art by Alexandra Melnikova]]</text>
    </revision>
    <revision>
      <id>3310</id>
      <timestamp>2012-12-04T19:42:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="48">[[Category:Concept art]]
[[Category:Art by MAD]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Brigand Sword2.jpg</title>
    <ns>6</ns>
    <id>380</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3063</id>
      <timestamp>2012-11-30T09:16:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Captive1.jpg</title>
    <ns>6</ns>
    <id>382</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3065</id>
      <timestamp>2012-11-30T09:17:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Cultist.jpg</title>
    <ns>6</ns>
    <id>384</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3067</id>
      <timestamp>2012-11-30T09:17:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Lady.jpg</title>
    <ns>6</ns>
    <id>387</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3070</id>
      <timestamp>2012-11-30T09:18:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Nupraptor1.jpg</title>
    <ns>6</ns>
    <id>388</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3071</id>
      <timestamp>2012-11-30T09:18:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Nupraptor2.jpg</title>
    <ns>6</ns>
    <id>389</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3072</id>
      <timestamp>2012-11-30T09:18:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Nupraptors Head.jpg</title>
    <ns>6</ns>
    <id>390</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3073</id>
      <timestamp>2012-11-30T09:18:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Nupraptors Throne.jpg</title>
    <ns>6</ns>
    <id>391</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3074</id>
      <timestamp>2012-11-30T09:18:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Gamerxxl Scare crow.jpg</title>
    <ns>6</ns>
    <id>392</id>
      <sha1>em405quby1wwt6fx7bhd96st6yjc7v1</sha1>
    <revision>
      <id>3075</id>
      <timestamp>2012-11-30T09:18:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by GamerXXL]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by GamerXXL]]</text>
    </revision>
  </page>
  <page>
    <title>File:Hedgenok crystal.jpg</title>
    <ns>6</ns>
    <id>428</id>
      <sha1>la76h295c9vczy9bg9439y52lattzzi</sha1>
    <revision>
      <id>3111</id>
      <timestamp>2012-11-30T09:39:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Hedgenok]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by Hedgenok]]</text>
    </revision>
  </page>
  <page>
    <title>File:Hedgenok some little demon.jpg</title>
    <ns>6</ns>
    <id>429</id>
      <sha1>la76h295c9vczy9bg9439y52lattzzi</sha1>
    <revision>
      <id>3112</id>
      <timestamp>2012-11-30T09:40:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Hedgenok]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by Hedgenok]]</text>
    </revision>
  </page>
  <page>
    <title>File:Hedgenok soultrapper.jpg</title>
    <ns>6</ns>
    <id>430</id>
      <sha1>la76h295c9vczy9bg9439y52lattzzi</sha1>
    <revision>
      <id>3113</id>
      <timestamp>2012-11-30T09:40:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Hedgenok]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by Hedgenok]]</text>
    </revision>
  </page>
  <page>
    <title>File:Hedgenok wolf.jpg</title>
    <ns>6</ns>
    <id>431</id>
      <sha1>la76h295c9vczy9bg9439y52lattzzi</sha1>
    <revision>
      <id>3114</id>
      <timestamp>2012-11-30T09:40:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by Hedgenok]]</comment>
      <text xml:space="preserve" bytes="53">[[Category:Concept art]]
[[Category:Art by Hedgenok]]</text>
    </revision>
  </page>
  <page>
    <title>File:Heightmap tiles.jpg</title>
    <ns>6</ns>
    <id>120</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1238</id>
      <timestamp>2012-07-18T11:43:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon archive.png</title>
    <ns>6</ns>
    <id>242</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2522</id>
      <timestamp>2012-08-09T11:35:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon file.png</title>
    <ns>6</ns>
    <id>241</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2521</id>
      <timestamp>2012-08-09T11:23:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2527</id>
      <timestamp>2012-08-09T12:01:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Icon file.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon folder.png</title>
    <ns>6</ns>
    <id>240</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2519</id>
      <timestamp>2012-08-09T10:59:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2520</id>
      <timestamp>2012-08-09T11:07:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Icon folder.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon md3compiler.png</title>
    <ns>6</ns>
    <id>269</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2613</id>
      <timestamp>2012-08-09T19:58:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon omnicide.png</title>
    <ns>6</ns>
    <id>268</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2589</id>
      <timestamp>2012-08-09T18:54:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon raw.png</title>
    <ns>6</ns>
    <id>243</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2523</id>
      <timestamp>2012-08-09T11:45:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2524</id>
      <timestamp>2012-08-09T11:48:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Icon raw.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2526</id>
      <timestamp>2012-08-09T12:00:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Icon raw.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Icon texture.png</title>
    <ns>6</ns>
    <id>244</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2525</id>
      <timestamp>2012-08-09T11:50:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Important.png</title>
    <ns>6</ns>
    <id>142</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1804</id>
      <timestamp>2012-07-26T13:17:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>1945</id>
      <timestamp>2012-07-27T10:42:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>2183</id>
      <timestamp>2012-07-29T21:01:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Jam1.png</title>
    <ns>6</ns>
    <id>286</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2817</id>
      <timestamp>2012-11-22T05:19:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Jam2.png</title>
    <ns>6</ns>
    <id>287</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2818</id>
      <timestamp>2012-11-22T05:19:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Jam3.png</title>
    <ns>6</ns>
    <id>288</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2819</id>
      <timestamp>2012-11-22T05:19:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Jam4.png</title>
    <ns>6</ns>
    <id>289</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2820</id>
      <timestamp>2012-11-22T05:20:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Jam5.png</title>
    <ns>6</ns>
    <id>290</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2821</id>
      <timestamp>2012-11-22T05:20:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Jam6.png</title>
    <ns>6</ns>
    <id>291</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2822</id>
      <timestamp>2012-11-22T05:20:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Lakdav ariel spectre.jpg</title>
    <ns>6</ns>
    <id>325</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3004</id>
      <timestamp>2012-11-30T08:10:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
    <revision>
      <id>3005</id>
      <timestamp>2012-11-30T08:12:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Lakdav ariel spectre.jpg]]&amp;quot;: [[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav azimuth det.jpg</title>
    <ns>6</ns>
    <id>327</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3007</id>
      <timestamp>2012-11-30T08:12:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav azimuth.jpg</title>
    <ns>6</ns>
    <id>326</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3006</id>
      <timestamp>2012-11-30T08:12:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav bane det.jpg</title>
    <ns>6</ns>
    <id>329</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3009</id>
      <timestamp>2012-11-30T08:13:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav bane.jpg</title>
    <ns>6</ns>
    <id>328</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3008</id>
      <timestamp>2012-11-30T08:12:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav cave abomination.jpg</title>
    <ns>6</ns>
    <id>320</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>2978</id>
      <timestamp>2012-11-29T22:10:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav concubine.jpg</title>
    <ns>6</ns>
    <id>330</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3010</id>
      <timestamp>2012-11-30T08:13:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav dejoule.jpg</title>
    <ns>6</ns>
    <id>331</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3011</id>
      <timestamp>2012-11-30T08:13:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav elzevir.jpg</title>
    <ns>6</ns>
    <id>332</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3012</id>
      <timestamp>2012-11-30T08:13:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav insectbeast.jpg</title>
    <ns>6</ns>
    <id>333</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3013</id>
      <timestamp>2012-11-30T08:13:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav irmok.jpg</title>
    <ns>6</ns>
    <id>334</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3014</id>
      <timestamp>2012-11-30T08:14:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav king ottmar.jpg</title>
    <ns>6</ns>
    <id>335</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3015</id>
      <timestamp>2012-11-30T08:14:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav malek det.jpg</title>
    <ns>6</ns>
    <id>337</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3017</id>
      <timestamp>2012-11-30T08:14:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav malek.jpg</title>
    <ns>6</ns>
    <id>336</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3016</id>
      <timestamp>2012-11-30T08:14:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav nemesis.jpg</title>
    <ns>6</ns>
    <id>338</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3018</id>
      <timestamp>2012-11-30T08:14:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav vorador.jpg</title>
    <ns>6</ns>
    <id>339</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3019</id>
      <timestamp>2012-11-30T08:15:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lakdav witch.jpg</title>
    <ns>6</ns>
    <id>340</id>
      <sha1>oyfnmqvvzp0x9flyh15j78bu4d5zdig</sha1>
    <revision>
      <id>3020</id>
      <timestamp>2012-11-30T08:15:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Concept art]]
[[Category:Art by David Lakatos]]</comment>
      <text xml:space="preserve" bytes="58">[[Category:Concept art]]
[[Category:Art by David Lakatos]]</text>
    </revision>
  </page>
  <page>
    <title>File:Lightmap deluxemap.jpg</title>
    <ns>6</ns>
    <id>137</id>
      <sha1>m4bov0kfpmerm2vfei08joyjjf56xv9</sha1>
    <revision>
      <id>1736</id>
      <timestamp>2012-07-23T12:24:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Glossary]]</comment>
      <text xml:space="preserve" bytes="21">[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1776</id>
      <timestamp>2012-07-25T10:36:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Lightmap vs vertexlight.jpg</title>
    <ns>6</ns>
    <id>156</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1949</id>
      <timestamp>2012-07-27T10:56:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Normalmap bowl.jpg</title>
    <ns>6</ns>
    <id>121</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1239</id>
      <timestamp>2012-07-18T11:44:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Normalsmoothing.jpg</title>
    <ns>6</ns>
    <id>273</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2673</id>
      <timestamp>2012-09-25T18:30:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Omnieditor1.jpg</title>
    <ns>6</ns>
    <id>664</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>3684</id>
      <timestamp>2013-10-02T15:28:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageAncient.png</title>
    <ns>6</ns>
    <id>65</id>
      <sha1>0t5jiibdq6k1tam9oy4zt1yld5iz80u</sha1>
    <revision>
      <id>449</id>
      <timestamp>2012-07-14T20:32:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Templates]]</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>628</id>
      <timestamp>2012-07-15T01:20:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:PageAncient.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>632</id>
      <timestamp>2012-07-15T01:29:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:PageAncient.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>671</id>
      <timestamp>2012-07-15T01:50:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="26">[[Category:Article flags]]</text>
    </revision>
    <revision>
      <id>2161</id>
      <timestamp>2012-07-29T14:13:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="23">[[Category:Page marks]]</text>
    </revision>
    <revision>
      <id>2176</id>
      <timestamp>2012-07-29T20:59:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageBadGrammar.png</title>
    <ns>6</ns>
    <id>179</id>
      <sha1>oa4r82sfl2gond3ohj143ko52m66ifn</sha1>
    <revision>
      <id>2165</id>
      <timestamp>2012-07-29T20:45:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Page marks]]</comment>
      <text xml:space="preserve" bytes="23">[[Category:Page marks]]</text>
    </revision>
    <revision>
      <id>2177</id>
      <timestamp>2012-07-29T21:00:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageImported.png</title>
    <ns>6</ns>
    <id>200</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2339</id>
      <timestamp>2012-08-01T09:19:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageOutdated.png</title>
    <ns>6</ns>
    <id>68</id>
      <sha1>0t5jiibdq6k1tam9oy4zt1yld5iz80u</sha1>
    <revision>
      <id>450</id>
      <timestamp>2012-07-14T20:33:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Templates]]</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>629</id>
      <timestamp>2012-07-15T01:21:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:PageOutdated.png]]&amp;quot;: [[Category:Templates]]</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>657</id>
      <timestamp>2012-07-15T01:41:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:PageOutdated.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>672</id>
      <timestamp>2012-07-15T01:50:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="26">[[Category:Article flags]]</text>
    </revision>
    <revision>
      <id>2158</id>
      <timestamp>2012-07-29T14:12:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>2162</id>
      <timestamp>2012-07-29T14:13:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="23">[[Category:Page marks]]</text>
    </revision>
    <revision>
      <id>2178</id>
      <timestamp>2012-07-29T21:00:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageScreenshot.png</title>
    <ns>6</ns>
    <id>173</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2036</id>
      <timestamp>2012-07-27T15:02:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageUnfinished.png</title>
    <ns>6</ns>
    <id>151</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1909</id>
      <timestamp>2012-07-27T09:37:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>1926</id>
      <timestamp>2012-07-27T09:59:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[File:Article unfinished2.png]] to [[File:PageUnfinished.png]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>1927</id>
      <timestamp>2012-07-27T10:00:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="26">[[Category:Article flags]]</text>
    </revision>
    <revision>
      <id>1930</id>
      <timestamp>2012-07-27T10:06:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:PageUnfinished.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="26">[[Category:Article flags]]</text>
    </revision>
    <revision>
      <id>2159</id>
      <timestamp>2012-07-29T14:12:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="23">[[Category:Page marks]]</text>
    </revision>
    <revision>
      <id>2179</id>
      <timestamp>2012-07-29T21:00:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:PageWIP.png</title>
    <ns>6</ns>
    <id>66</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>630</id>
      <timestamp>2012-07-15T01:24:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>631</id>
      <timestamp>2012-07-15T01:24:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>633</id>
      <timestamp>2012-07-15T01:29:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:PageUnfinished.png]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="22">[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>673</id>
      <timestamp>2012-07-15T01:50:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="26">[[Category:Article flags]]</text>
    </revision>
    <revision>
      <id>1922</id>
      <timestamp>2012-07-27T09:53:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[File:PageUnfinished.png]] to [[File:PageWIP.png]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="26">[[Category:Article flags]]</text>
    </revision>
    <revision>
      <id>2160</id>
      <timestamp>2012-07-29T14:13:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="23">[[Category:Page marks]]</text>
    </revision>
    <revision>
      <id>2180</id>
      <timestamp>2012-07-29T21:00:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Radiant brush.jpg</title>
    <ns>6</ns>
    <id>87</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>856</id>
      <timestamp>2012-07-16T18:07:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>857</id>
      <timestamp>2012-07-16T18:07:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="37">Brush of crypt entrance in NetRadiant</text>
    </revision>
  </page>
  <page>
    <title>File:Reference.png</title>
    <ns>6</ns>
    <id>136</id>
      <sha1>kmlqpu5tsyiwl6fbhvgzpfdwq99ucbh</sha1>
    <revision>
      <id>1691</id>
      <timestamp>2012-07-23T10:03:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>[[Category:Formatting templates]]</comment>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>2184</id>
      <timestamp>2012-07-29T21:01:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tip.png</title>
    <ns>6</ns>
    <id>148</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>1826</id>
      <timestamp>2012-07-26T14:21:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>1946</id>
      <timestamp>2012-07-27T10:42:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="33">[[Category:Formatting templates]]</text>
    </revision>
    <revision>
      <id>2185</id>
      <timestamp>2012-07-29T21:01:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial md3 01.jpg</title>
    <ns>6</ns>
    <id>192</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2331</id>
      <timestamp>2012-08-01T08:21:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial md3 02.jpg</title>
    <ns>6</ns>
    <id>193</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2332</id>
      <timestamp>2012-08-01T08:21:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial md3 03.jpg</title>
    <ns>6</ns>
    <id>194</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2333</id>
      <timestamp>2012-08-01T08:22:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial md3 04.jpg</title>
    <ns>6</ns>
    <id>195</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2334</id>
      <timestamp>2012-08-01T08:23:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2372</id>
      <timestamp>2012-08-01T14:14:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX uploaded a new version of &amp;quot;[[File:Tutorial md3 04.jpg]]&amp;quot;</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-1 a.jpg</title>
    <ns>6</ns>
    <id>251</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2566</id>
      <timestamp>2012-08-09T15:16:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-1 b.jpg</title>
    <ns>6</ns>
    <id>252</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2567</id>
      <timestamp>2012-08-09T15:16:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-1 c.jpg</title>
    <ns>6</ns>
    <id>253</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2568</id>
      <timestamp>2012-08-09T15:16:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-1 d.jpg</title>
    <ns>6</ns>
    <id>254</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2569</id>
      <timestamp>2012-08-09T15:17:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-2 a.jpg</title>
    <ns>6</ns>
    <id>255</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2570</id>
      <timestamp>2012-08-09T15:17:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-2 b.jpg</title>
    <ns>6</ns>
    <id>256</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2571</id>
      <timestamp>2012-08-09T15:17:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-2 c.jpg</title>
    <ns>6</ns>
    <id>257</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2572</id>
      <timestamp>2012-08-09T15:17:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-2 d.jpg</title>
    <ns>6</ns>
    <id>258</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2573</id>
      <timestamp>2012-08-09T15:17:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-3 a.jpg</title>
    <ns>6</ns>
    <id>259</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2574</id>
      <timestamp>2012-08-09T15:17:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-3 b.jpg</title>
    <ns>6</ns>
    <id>260</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2575</id>
      <timestamp>2012-08-09T15:18:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-3 c.jpg</title>
    <ns>6</ns>
    <id>261</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2576</id>
      <timestamp>2012-08-09T15:18:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-3 d.jpg</title>
    <ns>6</ns>
    <id>262</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2577</id>
      <timestamp>2012-08-09T15:18:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-4 a.jpg</title>
    <ns>6</ns>
    <id>263</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2578</id>
      <timestamp>2012-08-09T15:18:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-4 b.jpg</title>
    <ns>6</ns>
    <id>264</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2579</id>
      <timestamp>2012-08-09T15:18:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-4 c.jpg</title>
    <ns>6</ns>
    <id>265</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2580</id>
      <timestamp>2012-08-09T15:18:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>File:Tutorial understanding vis fig-4 d.jpg</title>
    <ns>6</ns>
    <id>266</id>
      <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
    <revision>
      <id>2581</id>
      <timestamp>2012-08-09T15:18:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>Func group</title>
    <ns>0</ns>
    <id>275</id>
      <sha1>rjcminpbz6q4b28ny4ixido4915wmld</sha1>
    <revision>
      <id>2678</id>
      <timestamp>2012-09-25T19:55:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}} Func group is virtual entity used to group [[brush|brushes]] and [[patch mesh|patches]] together for convenience (selecting, moving, copying, etc). Also func_gr...&quot;</comment>
      <text xml:space="preserve" bytes="1595">{{unfinished}}
Func group is virtual entity used to group [[brush|brushes]] and [[patch mesh|patches]] together for convenience (selecting, moving, copying, etc). Also func_group can set explicit compiler-related entity keys to it's brushes. Regular entities cannot be grouped with func_group.

{{Important|When map is compiled, all func_group entities are merged into [[worldspawn]].}}

=== Entity key list ===
{{entity fields begin}}
|-
| Luxel scale
| _ls
| Lightmap pixel (luxel) size is scaled with this value. Lesser = better (luxel size cannot be less than 1 unit). Typical values are: 0.5 (double lightmap reqolution, high quality), 0.25 (quadruple lightmap resolution, very high quality), 2 (half lightmap size, low quality). Note that this is multiplier to default luxel size set by material or map build script.
|-
| Cast shadow group.
| _cs
| See [[shadow groups]].
|-
| Receive shadow group.
| _rs
| See [[shadow groups]].
|-
| Vertical texture projection
| _vp
| Forces a vertical texture projection to be used instead of brush/model/patch base UV coordinates. A value is size of texture in game units. Typical values are: 128, 200, 400 etc.
|-
| UV Scale 
| _uvs
| Scales U/V coordinates. For fixing badly scaled terrain models.
|-
| Smooth normals
| _np
| Sets normal smoothing for entity brushes. See [[normal smoothing]].
|-
| Patch meta
| _pm
| Forces [[patch mesh|curves]] to be baked as regular models.
|-
| Non solid
| _ns
| Disables BSP planes generation for entity brushes. Use on never-reachable surfaces or surfaces that will use BIH collisions (like brush terrain).
|}</text>
    </revision>
    <revision>
      <id>2679</id>
      <timestamp>2012-09-25T20:45:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1626">{{unfinished}}
Func group is virtual entity used to group [[brush|brushes]] and [[patch mesh|patches]] together for convenience (selecting, moving, copying, etc). Also func_group can set explicit compiler-related entity keys to it's brushes. Regular entities cannot be grouped with func_group.

{{Important|When map is compiled, all func_group entities are merged into [[worldspawn]].}}

=== Entity key list ===
{{entity fields begin}}
|-
| Luxel scale
| _ls
| Lightmap pixel (luxel) size is scaled with this value. Lesser = better (luxel size cannot be less than 1 unit). Typical values are: 0.5 (double lightmap reqolution, high quality), 0.25 (quadruple lightmap resolution, very high quality), 2 (half lightmap size, low quality). Note that this is multiplier to default luxel size set by material or map build script.
|-
| Cast shadow group.
| _cs
| See [[shadow groups]].
|-
| Receive shadow group.
| _rs
| See [[shadow groups]].
|-
| Vertical texture projection
| _vp
| Forces a vertical texture projection to be used instead of brush/model/patch base UV coordinates. A value is size of texture in game units. Typical values are: 128, 200, 400 etc.
|-
| UV Scale 
| _uvs
| Scales U/V coordinates. For fixing badly scaled terrain models.
|-
| Smooth normals
| _np
| Sets normal smoothing for entity brushes. See [[normal smoothing]].
|-
| Patch meta
| _pm
| Forces [[patch mesh|curves]] to be baked as regular models.
|-
| Non solid
| _ns
| Disables BSP planes generation for entity brushes. Use on never-reachable surfaces or surfaces that will use BIH collisions (like brush terrain).
|}

[[Category:Entity templates]]</text>
    </revision>
    <revision>
      <id>2681</id>
      <timestamp>2012-09-25T20:51:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1650">{{unfinished}}
Func group is virtual entity used to group [[brush|brushes]] and [[patch mesh|patches]] together for convenience (selecting, moving, copying, etc). Also func_group can set explicit compiler-related entity keys to it's brushes. Regular entities cannot be grouped with func_group.

{{Important|When map is compiled, all func_group entities are merged into [[worldspawn]].}}

=== Entity key list ===
{{entity fields begin}}
|-
| Luxel scale
| _ls
| Lightmap pixel (luxel) size is scaled with this value. Lesser = better (luxel size cannot be less than 1 unit). Typical values are: 0.5 (double lightmap reqolution, high quality), 0.25 (quadruple lightmap resolution, very high quality), 2 (half lightmap size, low quality). Note that this is multiplier to default luxel size set by material or map build script.
|-
| Cast shadow group.
| _cs
| See [[shadow groups]].
|-
| Receive shadow group.
| _rs
| See [[shadow groups]].
|-
| Vertical texture projection
| _vp
| Forces a vertical texture projection to be used instead of brush/model/patch base UV coordinates. A value is size of texture in game units. Typical values are: 128, 200, 400 etc.
|-
| UV Scale 
| _uvs
| Scales U/V coordinates. For fixing badly scaled terrain models.
|-
| Smooth normals
| _np
| Sets normal smoothing for entity brushes. See [[normal smoothing]].
|-
| Patch meta
| _pm
| Forces [[patch mesh|curves]] to be baked as regular models.
|-
| Non solid
| _ns
| Disables BSP planes generation for entity brushes. Use on never-reachable surfaces or surfaces that will use BIH collisions (like brush terrain).
|}

[[Category:Entity definitions]]
[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>Gamemodel script</title>
    <ns>0</ns>
    <id>22</id>
      <sha1>1itcz56xentc3qwt9rx2l4xc1tpglrl</sha1>
    <revision>
      <id>296</id>
      <timestamp>2012-07-03T12:59:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Gamemodel script is [[.NSX files | NSX]&quot;</comment>
      <text xml:space="preserve" bytes="39">Gamemodel script is [[.NSX files | NSX]</text>
    </revision>
    <revision>
      <id>297</id>
      <timestamp>2012-07-03T12:59:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="40">Gamemodel script is [[.NSX files | NSX]]</text>
    </revision>
    <revision>
      <id>299</id>
      <timestamp>2012-07-03T13:04:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="603">= Introduction =

Gamemodel script is [[NSX | .NSX files]] to configure [[misc_gamemodel]] and [[func_gamemodel]].\

Gamemodel script is part of entity configuration script, and, currently the only one member of it.

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed</text>
    </revision>
    <revision>
      <id>300</id>
      <timestamp>2012-07-03T13:06:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="703">= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it.

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a varety of different behaviors of a gamemodel.</text>
    </revision>
    <revision>
      <id>301</id>
      <timestamp>2012-07-03T13:36:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="884">= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it.

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:

* animating gamemodel (cre
* addin new [[Call event | call commands]] to a gamemodel
* changing a skin
* make pushable gamemodel
* make destructibles
* set up physicsal properies</text>
    </revision>
    <revision>
      <id>374</id>
      <timestamp>2012-07-10T18:40:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="890">= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it.

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:

* animating gamemodel (cre
* addin new [[Trigger event | trigger commands]] to a gamemodel
* changing a skin
* make pushable gamemodel
* make destructibles
* set up physicsal properies</text>
    </revision>
    <revision>
      <id>421</id>
      <timestamp>2012-07-13T13:48:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1117">= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, perameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:

* animating gamemodel (cre
* addin new [[Trigger event | trigger commands]] to a gamemodel
* changing a skin
* make pushable gamemodel
* make destructibles
* set up physicsal properies</text>
    </revision>
    <revision>
      <id>422</id>
      <timestamp>2012-07-13T13:49:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1117">= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, parameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:

* animating gamemodel (cre
* addin new [[Trigger event | trigger commands]] to a gamemodel
* changing a skin
* make pushable gamemodel
* make destructibles
* set up physicsal properies</text>
    </revision>
    <revision>
      <id>423</id>
      <timestamp>2012-07-13T13:49:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="931">= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, parameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:</text>
    </revision>
    <revision>
      <id>693</id>
      <timestamp>2012-07-15T02:06:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="955">{{article unfinished}}

= Introduction =

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, parameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

= Usage =

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:</text>
    </revision>
    <revision>
      <id>1061</id>
      <timestamp>2012-07-17T20:41:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="959">{{article unfinished}}

== Introduction ==

Gamemodel script is [[NSX | .NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, parameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

== Usage ==

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:</text>
    </revision>
    <revision>
      <id>1112</id>
      <timestamp>2012-07-17T23:10:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="958">{{article unfinished}}

== Introduction ==

Gamemodel script is [[NSX | NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, parameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

== Usage ==

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:</text>
    </revision>
    <revision>
      <id>2002</id>
      <timestamp>2012-07-27T14:01:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="950">{{unfinished}}

== Introduction ==

Gamemodel script is [[NSX | NSX files]] used to configure [[misc_gamemodel]] and [[func_gamemodel]].

Gamemodel script is part of entity configuration script, and currently, the only one member of it. 

Gamemodel script is used to define various aspects of a game model:

# Trigger events
# Animations
# States (open / closed, active, inactive etc.)
# Physics (bound box, parameters etc.)
# Interactivity (pushing, destruction)

Example of gamemodel script:

 ['''entity''']
 configurations=gamemodel
 ['''gamemodel''']
 scripts=unpress,press,pressed,ready
 states=ready-&gt;press,pressed-&gt;unpress
 state=ready
 call=nextstate
 ['''ready''']
 frame=0
 ['''unpress''']
 sound=legacy/switch.wav
 animate=5 0 20
 state=ready
 ['''pressed''']
 frame=5
 ['''press''']
 sound=legacy/switch.wav
 animate=0 5 20
 state=pressed

== Usage ==

Gamemodel script can be used to set a variety of different behaviors of a gamemodel:</text>
    </revision>
  </page>
  <page>
    <title>Gametime</title>
    <ns>0</ns>
    <id>118</id>
      <sha1>7nfo9cx7oxw5svdrejpegs76cr8upgi</sha1>
    <revision>
      <id>1073</id>
      <timestamp>2012-07-17T21:49:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Time spent since game was started and keeped from level to level.  In Blood omnicide gametime is represented by vector: * x - days since game started * y - day hours * z - hou...&quot;</comment>
      <text xml:space="preserve" bytes="384">Time spent since game was started and keeped from level to level.

In Blood omnicide gametime is represented by vector:
* x - days since game started
* y - day hours
* z - hour minutes

So '5 21 31' represents day 5, 21 hour 31 minutes.

== Known constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1074</id>
      <timestamp>2012-07-17T21:54:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="599">Time spent since game was started and keeped from level to level.

In Blood omnicide gametime is represented by vector:
* x - days since game started
* y - day hours
* z - hour minutes

== Representations ==

=== String ===

Gametime is represented as string vector:

Example:
 // day 5, 21 hour 31 minutes
 '5 21 31'

=== Float (daytime) ===

Daytime float is days spent since game start + day fraction.

Example:
 // 6 days 17 hours 4 minutes
 6.711

== Known constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1075</id>
      <timestamp>2012-07-17T21:55:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="598">Time spent since game was started and keeped from level to level.

In Blood omnicide gametime is represented by vector:
* x - days since game started
* y - day hours
* z - hour minutes

== Representations ==
=== String ===

Gametime is represented as string vector:

Example:
 // day 5, 21 hour 31 minutes
 '5 21 31'

=== Float (daytime) ===

Daytime float is days spent since game start + day fraction.

Example:
 // 6 days 17 hours 4 minutes
 6.711

== Known constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1076</id>
      <timestamp>2012-07-17T21:55:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="609">Time spent since game was started and keeped from level to level.

In Blood omnicide gametime is represented by vector:
* x - days since game started
* y - day hours
* z - hour minutes

== Representations ==
=== String ===

Gametime is represented as string vector:

Example:
 // day 5, 21 hour 31 minutes
 '5 21 31'

=== Float (daytime) ===

Daytime float is days spent since game start + day fraction.

Example:
 // 6 days 17 hours 4 minutes
 6.711

== Known constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1077</id>
      <timestamp>2012-07-17T22:16:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1248">Time spent since game was started and keeped from level to level.

In Blood Omnicide gamecode, gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== String gametime ===

String vector:
 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time float ===

Moon cycle time is 28 days.
Moon cycle origin is 12 AM.
In order to get full mon at game start, moon cycle origin is set to -10 days.

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.

 // day 5, 21 hour 31 minutes
 0.5499


== Known constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1078</id>
      <timestamp>2012-07-17T22:19:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1259">Time spent since game was started and keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 265 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

In gamecode, gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== String gametime ===

String vector:
 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time float ===

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.

 // day 5, 21 hour 31 minutes
 0.5499

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1079</id>
      <timestamp>2012-07-17T22:20:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1246">Time spent since game was started and keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 265 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

In gamecode, gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.
 // day 5, 21 hour 31 minutes
 0.5499

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1080</id>
      <timestamp>2012-07-17T22:20:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1242">Time spent since game was starte. Keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 265 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

In gamecode, gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.
 // day 5, 21 hour 31 minutes
 0.5499

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1081</id>
      <timestamp>2012-07-17T22:20:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1243">Time spent since game was starte. Keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 265 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

In gamecode, gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.
 // day 5, 21 hour 31 minutes
 0.5499

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1082</id>
      <timestamp>2012-07-17T22:21:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1243">Time spent since game was starte. Keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

In gamecode, gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.
 // day 5, 21 hour 31 minutes
 0.5499

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1083</id>
      <timestamp>2012-07-17T22:21:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1240">Time spent since game was starte. Keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Moon phases (0-100%):
* 0% - new
* 0-50% - raise
* 50% - full
* 50-100% - fall

Moon time is represented by float moon cycles + cycle fraction.
 // day 5, 21 hour 31 minutes
 0.5499

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1084</id>
      <timestamp>2012-07-17T22:31:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1237">Time spent since game was starte. Keeped from level to level.

== Blood Omnicide constants ==
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1085</id>
      <timestamp>2012-07-17T22:31:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1226">Time spent since game was starte. Keeped from level to level.

==== constants ====
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1086</id>
      <timestamp>2012-07-17T22:32:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1248">Time spent since game was starte. Keeped from level to level.

==== Constants ====
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1087</id>
      <timestamp>2012-07-17T22:32:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1250">Time spent since game was starte. Keeped from level to level.

===== Constants =====
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1165</id>
      <timestamp>2012-07-17T23:59:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1263">Time spent since game was starte. Keeped from level to level.

Blood Omnicide gametime constants:
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1217</id>
      <timestamp>2012-07-18T09:21:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1264">Time spent since game was started. Keeped from level to level.

Blood Omnicide gametime constants:
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1218</id>
      <timestamp>2012-07-18T09:22:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console commands (debug only) */</comment>
      <text xml:space="preserve" bytes="1283">Time spent since game was started. Keeped from level to level.

Blood Omnicide gametime constants:
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string (restart required)

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1219</id>
      <timestamp>2012-07-18T09:22:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console commands (debug only) */</comment>
      <text xml:space="preserve" bytes="1289">Time spent since game was started. Keeped from level to level.

Blood Omnicide gametime constants:
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string ('''restart''' required)

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>2295</id>
      <timestamp>2012-07-30T21:47:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1301">Time spent since game was started. Keeped from level to level.

Blood Omnicide gametime constants:
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

== Console commands (debug only) ==

* '''cmd gametime''' - show current time
* '''timeflow''' ''X'' - set time flow speed
* '''timetest''' ''X'' - start a level with certain gametime string ('''restart''' required)

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2296</id>
      <timestamp>2012-07-30T21:49:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console commands (debug only) */</comment>
      <text xml:space="preserve" bytes="1295">Time spent since game was started. Keeped from level to level.

Blood Omnicide gametime constants:
* Kain starts a game at day 0 ~8 PM
* When Kain is being ressurected as vampire, gametime: day 4 ~8 PM
* 1 game minute per real second
* 60 minutes per hour
* 24 hours per day
* 365 days per year
* 28 days per moon cycle
* moon cycle origin - day 9, 12 AM

== Representation ==

Generally gametime is represented by vector:
* x - minutes
* y - hours
* z - days since game started

But in scripts, gametime may be represented in different ways.

=== Vector string (gametime) ===

 // day 5, 21 hour 31 minutes
 '32 21 5'

=== Float (daytime) ===

Days spent since game start + day fraction:
 // day 5, 21 hour 31 minutes
 5.8965

=== Float (yeartime) ===

Year spent since game start + year fraction:
 // day 5, 21 hour 31 minutes
 0.0161549

=== Moon time ===

Current moon cycle fraction:
 // day 5, 21 hour 31 minutes
 0.5499

Moon time as phases:
* 0 to 0.04 - new moon
* 0.04 to 0.5 - raise
* 0.5 to 0.54 - full moon
* 0.54 to 1 - fall

==Console commands (debug only)==
{{cmd|cmd gametime|show current time}}
{{cmd|timeflow speed|show current time}}
{{cmd|timetest &quot;gametime&quot;|start a level with certain gametime string ('''restart''' required)}}

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Infoportions</title>
    <ns>0</ns>
    <id>21</id>
      <sha1>6c6p858s44sugak3fjs1tihsh529nu1</sha1>
    <revision>
      <id>238</id>
      <timestamp>2012-07-03T07:12:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Infoportions is an array of special tokens, stored with players and game.  They are used to handle game progress.  * More info later&quot;</comment>
      <text xml:space="preserve" bytes="132">Infoportions is an array of special tokens, stored with players and game.

They are used to handle game progress.

* More info later</text>
    </revision>
    <revision>
      <id>694</id>
      <timestamp>2012-07-15T02:07:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="156">{{article unfinished}}

Infoportions is an array of special tokens, stored with players and game.

They are used to handle game progress.

* More info later</text>
    </revision>
    <revision>
      <id>720</id>
      <timestamp>2012-07-15T02:21:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="137">{{article unfinished}}

Infoportions is an array of special tokens, stored with players and game.

They are used to handle game progress.</text>
    </revision>
    <revision>
      <id>1203</id>
      <timestamp>2012-07-18T08:55:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1216">{{article unfinished}}

Infoportions is a pieces of information storing player's (or game) progress. They are used to identify if player was maked some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

While all infoportions shared name space, there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern scripts]]. Clever usage of them helps to make buttons that open doors in other levels, spawn additional monsters if Kain was maked some special action and other event chains. 

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1204</id>
      <timestamp>2012-07-18T08:56:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1198">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was maked some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

While all infoportions shared name space, there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern scripts]]. Clever usage of them helps to make buttons that open doors in other levels, spawn additional monsters if Kain was maked some special action and other event chains. 

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1205</id>
      <timestamp>2012-07-18T09:10:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1950">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was maked some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern scripts]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

&lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''_k''' - killed
* '''_a''' - activated
* '''_p''' - pressed
* '''_o''' - opened
* '''_c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1206</id>
      <timestamp>2012-07-18T09:10:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1951">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was maked some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern scripts]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''_k''' - killed
* '''_a''' - activated
* '''_p''' - pressed
* '''_o''' - opened
* '''_c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1207</id>
      <timestamp>2012-07-18T09:11:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Usage */</comment>
      <text xml:space="preserve" bytes="1946">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was maked some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern scripts]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1208</id>
      <timestamp>2012-07-18T09:11:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1950">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern scripts]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1209</id>
      <timestamp>2012-07-18T09:11:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Usage */</comment>
      <text xml:space="preserve" bytes="1949">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to use infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1210</id>
      <timestamp>2012-07-18T09:12:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Usage */</comment>
      <text xml:space="preserve" bytes="1952">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1211</id>
      <timestamp>2012-07-18T09:12:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1984">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1212</id>
      <timestamp>2012-07-18T09:12:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1984">{{article unfinished}}

Pieces of information storing player's (or game) progress. They are used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1214</id>
      <timestamp>2012-07-18T09:13:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1960">Pieces of information storing player's (or game) progress. They are used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1215</id>
      <timestamp>2012-07-18T09:13:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1951">Pieces of information storing player's (or game) progress. Used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1216</id>
      <timestamp>2012-07-18T09:16:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2192">Pieces of information (strings) storing player's (or game) progress. Used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels and also used for game stats and achievements.

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1260</id>
      <timestamp>2012-07-18T17:18:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2175">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player was performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.). Infoportions store data across levels.

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1261</id>
      <timestamp>2012-07-18T17:19:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2132">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions shares same name space there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1262</id>
      <timestamp>2012-07-18T17:19:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2132">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions share same name space, there is some standarts of naming to get rid of collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1263</id>
      <timestamp>2012-07-18T17:20:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2137">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions share same name space, some standarts of naming should be followed to avoid collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

Infoportions can have values attached.

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1264</id>
      <timestamp>2012-07-18T17:21:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2123">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global, can have values attached. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions share same name space, some standarts of naming should be followed to avoid collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage on infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1265</id>
      <timestamp>2012-07-18T17:22:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2123">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global, can have values attached. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions share same name space, some standarts of naming should be followed to avoid collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage of infoportions for level design:
* When having same NPC in two maps (like barkeep in Ziegsturhl tavern), when one is killed, another should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1266</id>
      <timestamp>2012-07-18T17:23:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2160">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global, can have values attached. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

As all infoportions share same name space, some standarts of naming should be followed to avoid collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage of infoportions for level design:
* In some maps, there is two or moreentities representing same NPC (like barkeep in Ziegsturhl tavern), when one is killed, another ones should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>1271</id>
      <timestamp>2012-07-19T15:45:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2186">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global, can have values attached. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

== Naming conventions ==

As all infoportions share same name space, some standarts of naming should be followed to avoid collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage of infoportions for level design:
* In some maps, there is two or moreentities representing same NPC (like barkeep in Ziegsturhl tavern), when one is killed, another ones should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]
* [[Zone event]]</text>
    </revision>
    <revision>
      <id>2852</id>
      <timestamp>2012-11-22T11:34:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2169">Pieces of information (strings) storing player's (or game) progress, achievements and game stats. Used to identify if player performed some action (touched some trigger, killed monster, activated batmark, checked out monologue mark etc.).

Example player infoportions array:
 comment_sun // sun monologue (in the light of the sun i have no comfort...) was executed
 comment_rain // rain monologue was executed
 w1m3_crypt1button_p // button 1 was pressed in light crypt

Infoportions could be local or global, can have values attached. Local infoportions belongs to player/npc, while global belongs to game and being active on all players.

== Naming conventions ==

As all infoportions share same name space, some standarts of naming should be followed to avoid collisions. 

* Inventory-related infoportions are prefixed by &quot;inv_&quot;
* Level-related and level-interaction infoportions set by level designer are prefixed by the [[Blood Omnicide Locations | worldnum and mapnum]] they are targeted to (w1m1_, w1m4_ etc.)
* Kain's eventual comments (snow, rain etc.) are prefixed by &quot;comment_&quot;.
* Global infoportions always prefixed by #

== Usage ==

For level designer, generic way to access infoportions is [[Trigger event]] and [[Pattern script]]. Trigger event allows to add new infoportions or values (in the form of counters). Pattern scripts allows to check for any infoportions (including gamecode-related, such as gamestats).

To make life easier, it is useful to name all infoportions using this rule:

 &lt;font size=4&gt;'''''mapname''_''objectname''_''eventhappened'''''&lt;/font&gt;

Typical mapnames:
* w1m1
* w1m2
* etc

Typical objectnames:
* button1
* secretbutton
* barkeep
* brigands
* etc.

Typical events:
* '''k''' - killed
* '''a''' - activated
* '''p''' - pressed
* '''o''' - opened
* '''c''' - closed
* etc.

Typical usage of infoportions for level design:
* In some maps, there is two or moreentities representing same NPC (like barkeep in Ziegsturhl tavern), when one is killed, another ones should be removed too.
* Open doors, activate stuff in another levels.
* Spawn more enemies when kain kills someone.

== See also ==
* [[Blood Omnicide Game stats]]</text>
    </revision>
  </page>
  <page>
    <title>Insect beast</title>
    <ns>0</ns>
    <id>587</id>
      <sha1>nipp87f6kfor0plf6dpd6527b0moiwp</sha1>
    <revision>
      <id>3317</id>
      <timestamp>2012-12-07T19:41:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden|bo_enemy_insectbeast.gif|Insect beast}} Insect-like monster with thin and sharp claws. Inhabits outdoors and caves near Dark Eden.  ==Stats==  :Health: 20 :Dama...&quot;</comment>
      <text xml:space="preserve" bytes="398">{{BoEnemy|eden|bo_enemy_insectbeast.gif|Insect beast}}
Insect-like monster with thin and sharp claws. Inhabits outdoors and caves near Dark Eden.

==Stats==

:Health: 20
:Damage: 10x2
:Blood: green
:Walk speed: fast
:Character type: animal
:Entity: [[enemy_insectbeast]]

==Concept art gallery==
&lt;gallery&gt;
File:Enigma insectbeast sketch.jpg
File:Lakdav insectbeast.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3346</id>
      <timestamp>2012-12-27T21:50:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="554">{{BoEnemy|eden|bo_enemy_insectbeast.gif|Insect beast}}
Insect-like monster with thin and sharp claws. Body is covered with red testa-like skin with black thin strips. Attack animation is quite similar to [[Cave beast|cave beast]]. Inhabits outdoors and caves near Dark Eden and also Avernus Cathedral.

==Stats==

:Health: 20
:Damage: 10x2
:Blood: green
:Walk speed: fast
:Character type: animal
:Entity: [[enemy_insectbeast]]

==Concept art gallery==
&lt;gallery&gt;
File:Enigma insectbeast sketch.jpg
File:Lakdav insectbeast.jpg
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Item antitoxin</title>
    <ns>0</ns>
    <id>37</id>
      <sha1>ghhdsx8i5moewnmbjodd2icug0fi498</sha1>
    <revision>
      <id>360</id>
      <timestamp>2012-07-06T20:56:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;If Kain became poisoned, Anti-Toxin is the cure.  {{entity_item_behavior}}  {{entity_fields}} {{entity_item_fields}} {{entity_common_fields|classname=item_antitoxin}} {{entity...&quot;</comment>
      <text xml:space="preserve" bytes="240">If Kain became poisoned, Anti-Toxin is the cure.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_antitoxin}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>796</id>
      <timestamp>2012-07-16T09:03:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="72">If Kain became poisoned, Anti-Toxin is the cure.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2319</id>
      <timestamp>2012-07-30T21:59:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="85">If Kain became poisoned, Anti-Toxin is the cure.

{{entity item common}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2387</id>
      <timestamp>2012-08-03T06:16:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="48">If Kain became poisoned, Anti-Toxin is the cure.</text>
    </revision>
    <revision>
      <id>2388</id>
      <timestamp>2012-08-03T06:16:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="72">If Kain became poisoned, Anti-Toxin is the cure.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2389</id>
      <timestamp>2012-08-03T06:17:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="85">If Kain became poisoned, Anti-Toxin is the cure.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item energybank</title>
    <ns>0</ns>
    <id>40</id>
      <sha1>t38mzs4krfzaqwwd2zhqfuoeyt9t1nc</sha1>
    <revision>
      <id>363</id>
      <timestamp>2012-07-06T20:57:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;These artefacts filled Kain's magic reserves for a while, but when their effect faded, Kain was left with no magical energy at all.  {{entity_item_behavior}}  {{entity_fields}...&quot;</comment>
      <text xml:space="preserve" bytes="324">These artefacts filled Kain's magic reserves for a while, but when their effect faded, Kain was left with no magical energy at all.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_energybank}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>799</id>
      <timestamp>2012-07-16T09:04:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="181">These artefacts filled Kain's magic reserves for a while, but when their effect faded, Kain was left with no magical energy at all.

{{entity_item_behavior}}

{{entity item common}}</text>
    </revision>
    <revision>
      <id>838</id>
      <timestamp>2012-07-16T16:41:07Z</timestamp>
      <contributor>
        <ip>89.179.235.231</ip>
      </contributor>
      <text xml:space="preserve" bytes="155">These artefacts filled Kain's magic reserves for a while, but when their effect faded, Kain was left with no magical energy at all.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2316</id>
      <timestamp>2012-07-30T21:59:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="168">These artefacts filled Kain's magic reserves for a while, but when their effect faded, Kain was left with no magical energy at all.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item flay</title>
    <ns>0</ns>
    <id>24</id>
      <sha1>ox2y29tqggpmj97t1ohukl5mrur5oqa</sha1>
    <revision>
      <id>303</id>
      <timestamp>2012-07-03T21:55:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.  == Item properties ==  When item is targeted by another entity, it becomes hidd...&quot;</comment>
      <text xml:space="preserve" bytes="1151">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Keys ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=5%  | Default
! width=75% | Description
|-
| target
| Target
|
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
|
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
|
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=4 | Common entity keys
|-
| classname
| Classname
| item_flay
| Entity class name
|-
| sid
| SaveID
|
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>304</id>
      <timestamp>2012-07-03T21:55:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Keys */</comment>
      <text xml:space="preserve" bytes="1157">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Keys ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=5%  | Default
! width=75% | Description
|-
| target
| Target
|
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
|
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
|
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=4 | '''Common entity keys'''
|-
| classname
| Classname
| item_flay
| Entity class name
|-
| sid
| SaveID
|
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>305</id>
      <timestamp>2012-07-03T21:56:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Keys */</comment>
      <text xml:space="preserve" bytes="1163">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Keys ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=5%  | Default value
! width=75% | Description
|-
| target
| Target
|
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
|
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
|
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=4 | '''Common entity keys'''
|-
| classname
| Classname
| item_flay
| Entity class name
|-
| sid
| SaveID
|
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>306</id>
      <timestamp>2012-07-03T21:56:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Keys */</comment>
      <text xml:space="preserve" bytes="1164">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Keys ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=10%  | Default value
! width=70% | Description
|-
| target
| Target
|
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
|
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
|
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=4 | '''Common entity keys'''
|-
| classname
| Classname
| item_flay
| Entity class name
|-
| sid
| SaveID
|
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>307</id>
      <timestamp>2012-07-03T21:56:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Keys */</comment>
      <text xml:space="preserve" bytes="1157">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Keys ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
|
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=4 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>308</id>
      <timestamp>2012-07-03T21:57:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1155">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Keys ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>309</id>
      <timestamp>2012-07-03T21:57:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Keys */</comment>
      <text xml:space="preserve" bytes="1164">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item properties ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>310</id>
      <timestamp>2012-07-03T21:58:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Item properties */</comment>
      <text xml:space="preserve" bytes="1162">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item behavior ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (not origin so you can target bmodels).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>311</id>
      <timestamp>2012-07-03T21:58:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Item behavior */</comment>
      <text xml:space="preserve" bytes="1164">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item behavior ==

When item is targeted by another entity, it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (so you can target [[bmodel | bmodels]]).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>313</id>
      <timestamp>2012-07-03T22:07:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Item behavior */</comment>
      <text xml:space="preserve" bytes="1168">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item behavior ==

When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (so you can target [[bmodel | bmodels]]).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden end got spawned when called by some entity. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>314</id>
      <timestamp>2012-07-03T22:09:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1221">Flay artefacts is projectiles that homed in on an enemy, then ripped the flesh from its bones.

== Item behavior ==

When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (so you can target [[bmodel | bmodels]]).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

=== Call parameters ===

Items have no special calling parameters.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden and got spawned when called. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>315</id>
      <timestamp>2012-07-03T22:10:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1224">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

== Item behavior ==

When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (so you can target [[bmodel | bmodels]]).

Note: once you target item to some entity, it will [[Call event | call]] it when picked, be careful.

=== Call parameters ===

Items have no special calling parameters.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden and got spawned when called. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>316</id>
      <timestamp>2012-07-03T22:11:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Item behavior */</comment>
      <text xml:space="preserve" bytes="1224">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

== Item behavior ==

When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (so you can target [[bmodel | bmodels]]).

Note: once you target item to some entity, it will [[Call event | call]] it when picked. Be careful.

=== Call parameters ===

Items have no special calling parameters.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden and got spawned when called. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>317</id>
      <timestamp>2012-07-03T22:12:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1264">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

== Item behavior ==

When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle move, target it to some entity, then it will start it's move from that entity center (so you can target [[bmodel | bmodels]]).

Note: once you target item to some entity, it will [[Call event | call]] it when picked. Be careful.

=== Call parameters ===

Items have no special calling parameters.

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| colspan=3 | '''Common item keys'''
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden and got spawned when called. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>319</id>
      <timestamp>2012-07-03T22:17:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="841">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{Entity_item_behavior}}

== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value
|-
| colspan=3 | '''Common item keys'''
|-
| target
| Target
| This entity till be called when item is picked.
|-
| targetparm
| Targer parameters
| Instructions for call event; Type &quot;nocall&quot; here to disable call event.
|-
| targetname
| Targetname
| If set, item becomes hidden and got spawned when called. If target is set, item will perform spawn move from the center of it's targeter.
|-
| colspan=3 | '''Common entity keys'''
|-
| classname
| Classname
| Entity class name
| item_flay
|-
| sid
| SaveID
| Entity [[SaveId]]
|}</text>
    </revision>
    <revision>
      <id>326</id>
      <timestamp>2012-07-03T22:21:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="228">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_keys}}
{{entity_common_keys|classname=item_flay}}
{{entity_fields_end}}</text>
    </revision>
    <revision>
      <id>328</id>
      <timestamp>2012-07-03T22:23:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="232">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}</text>
    </revision>
    <revision>
      <id>329</id>
      <timestamp>2012-07-03T22:24:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="265">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>343</id>
      <timestamp>2012-07-03T22:34:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="284">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>348</id>
      <timestamp>2012-07-04T09:06:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="524">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]

== FAQ's ==

* How to make item activate something once picked
 Q: sss
  A: vbbb
* How to make hidden item that spawns when called
* How to make hidden item that spawns with powerup animation
* How to prevent item from calling it's target</text>
    </revision>
    <revision>
      <id>349</id>
      <timestamp>2012-07-04T10:50:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="284">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>350</id>
      <timestamp>2012-07-06T20:50:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="321">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]

== See also ==
* [[Entity classes]]</text>
    </revision>
    <revision>
      <id>351</id>
      <timestamp>2012-07-06T20:50:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* See also */</comment>
      <text xml:space="preserve" bytes="284">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>398</id>
      <timestamp>2012-07-12T11:50:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Item flay]] to [[Entityclass:Item flay]]</comment>
      <text xml:space="preserve" bytes="284">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>402</id>
      <timestamp>2012-07-12T11:51:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Entityclass:Item flay]] to [[Item flay]] over a redirect without leaving a redirect</comment>
      <text xml:space="preserve" bytes="284">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>789</id>
      <timestamp>2012-07-16T08:57:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="121">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2323</id>
      <timestamp>2012-07-30T22:00:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="134">Flay artefacts is homing projectiles that flies to an enemy, then ripps the flesh from his bones.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item font</title>
    <ns>0</ns>
    <id>39</id>
      <sha1>ga47e0mb0hmnnv1qnw1oeujrhbb7370</sha1>
    <revision>
      <id>362</id>
      <timestamp>2012-07-06T20:57:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;These artefacts were homing projectiles that caused enemies to decompose upon contact. The pool left by their dissolved bodies acted as a trap, promising the same fate to anyo...&quot;</comment>
      <text xml:space="preserve" bytes="382">These artefacts were homing projectiles that caused enemies to decompose upon contact. The pool left by their dissolved bodies acted as a trap, promising the same fate to anyone that stood in it.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_font}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>798</id>
      <timestamp>2012-07-16T09:04:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="219">These artefacts were homing projectiles that caused enemies to decompose upon contact. The pool left by their dissolved bodies acted as a trap, promising the same fate to anyone that stood in it.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2317</id>
      <timestamp>2012-07-30T21:59:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="232">These artefacts were homing projectiles that caused enemies to decompose upon contact. The pool left by their dissolved bodies acted as a trap, promising the same fate to anyone that stood in it.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item heart</title>
    <ns>0</ns>
    <id>32</id>
      <sha1>m0md07u2t76hxgv9o0qceb8vw7m9ayn</sha1>
    <revision>
      <id>331</id>
      <timestamp>2012-07-03T22:27:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Kain's quote:  Reputed to have been ripped from the chest of the greatest vampire to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife. Life is p...&quot;</comment>
      <text xml:space="preserve" bytes="667">Kain's quote:
 Reputed to have been ripped from the chest of the greatest vampire to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife. Life is precious, Janos discovered - as it was torn throbbing and bleeding from his own body.

If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to improve his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>332</id>
      <timestamp>2012-07-03T22:28:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="674">Kain's quote:
 Reputed to have been ripped from the chest of the greatest vampire to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife. Life is precious, Janos discovered - as it was torn throbbing and bleeding from his own body.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>333</id>
      <timestamp>2012-07-03T22:28:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="675">Kain's quote:
 Reputed to have been ripped from the chest of the greatest vampire to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife.
 Life is precious, Janos discovered - as it was torn throbbing and bleeding from his own body.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>335</id>
      <timestamp>2012-07-03T22:30:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="693">{{Kain quote|pic=item_flay|text=Reputed to have been ripped from the chest of the greatest vampire to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife. Life is precious, Janos discovered - as it was torn throbbing and bleeding from his own body.}}

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>336</id>
      <timestamp>2012-07-03T22:30:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="696">{{Kain quote|pic=item_flay|text=Reputed to have been ripped from the chest of the greatest vampire 
 to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife.
 Life is precious, Janos discovered - as it was torn throbbing and bleeding from his own body.}}

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>337</id>
      <timestamp>2012-07-03T22:31:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="696">{{Kain quote|pic=item_flay|text=Reputed to have been ripped from the chest of the greatest vampire 
 to have ever existed, Janos Audron, the Heart of Darkness restores vampiric unlife.
 Life is precious, Janos discovered - as it was torn throbbing and bleeding from his own body.}}

If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>340</id>
      <timestamp>2012-07-03T22:33:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="413">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>341</id>
      <timestamp>2012-07-03T22:34:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="432">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>352</id>
      <timestamp>2012-07-06T20:52:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="477">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]

[[Entity classes | Back to entity classes]]</text>
    </revision>
    <revision>
      <id>353</id>
      <timestamp>2012-07-06T20:52:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="478">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]


[[Entity classes | Back to entity classes]]</text>
    </revision>
    <revision>
      <id>354</id>
      <timestamp>2012-07-06T20:52:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="480">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]




[[Entity classes | Back to entity classes]]</text>
    </revision>
    <revision>
      <id>355</id>
      <timestamp>2012-07-06T20:53:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="480">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}




[[Entity classes | Back to entity classes]]

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>356</id>
      <timestamp>2012-07-06T20:53:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="432">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>396</id>
      <timestamp>2012-07-12T11:50:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Item heart]] to [[Entityclass:Item heart]]: moving all entity class to Entityclass: namespace</comment>
      <text xml:space="preserve" bytes="432">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>401</id>
      <timestamp>2012-07-12T11:51:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Entityclass:Item heart]] to [[Item heart]] over a redirect without leaving a redirect</comment>
      <text xml:space="preserve" bytes="432">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_flay}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>766</id>
      <timestamp>2012-07-16T08:04:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="420">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity item common}}

{{entity fields}}
{{entity item fields}}
{{entity common fields|item_flay}}
{{entity fields end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>787</id>
      <timestamp>2012-07-16T08:55:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="321">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity item common}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>791</id>
      <timestamp>2012-07-16T08:58:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="269">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2322</id>
      <timestamp>2012-07-30T22:00:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="282">If Kain possessed a Heart of Darkness, it would instantly revive him if he was defeated by his enemies.

He could use the Heart of Darkness artefacts at any time to restore 1/3 of his health, adding the blood of the hearts to his own blood vial.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item implode</title>
    <ns>0</ns>
    <id>35</id>
      <sha1>m1vgspto84y80gp72skw5bs8yuddxyc</sha1>
    <revision>
      <id>358</id>
      <timestamp>2012-07-06T20:54:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;If these projectiles struck an enemy, their body rapidly compressed. The remains exploded when the internal pressure became too great to be contained.  {{entity_item_behavior}...&quot;</comment>
      <text xml:space="preserve" bytes="340">If these projectiles struck an enemy, their body rapidly compressed. The remains exploded when the internal pressure became too great to be contained.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_implode}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>794</id>
      <timestamp>2012-07-16T09:03:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="174">If these projectiles struck an enemy, their body rapidly compressed. The remains exploded when the internal pressure became too great to be contained.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2321</id>
      <timestamp>2012-07-30T21:59:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="187">If these projectiles struck an enemy, their body rapidly compressed. The remains exploded when the internal pressure became too great to be contained.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item pentalich</title>
    <ns>0</ns>
    <id>36</id>
      <sha1>d4sp0geniz0qb0nqflkt12b3yc160wz</sha1>
    <revision>
      <id>359</id>
      <timestamp>2012-07-06T20:55:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;The Tarot randomly pick how Kain's enemies would die.  {{entity_item_behavior}}  {{entity_fields}} {{entity_item_fields}} {{entity_common_fields|classname=item_pentalich}} {{e...&quot;</comment>
      <text xml:space="preserve" bytes="245">The Tarot randomly pick how Kain's enemies would die.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_pentalich}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>795</id>
      <timestamp>2012-07-16T09:03:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="77">The Tarot randomly pick how Kain's enemies would die.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2320</id>
      <timestamp>2012-07-30T21:59:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="90">The Tarot randomly pick how Kain's enemies would die.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item slowtime</title>
    <ns>0</ns>
    <id>38</id>
      <sha1>0ou95befqtkhlnwt2bp4nebsrudk2dl</sha1>
    <revision>
      <id>361</id>
      <timestamp>2012-07-06T20:56:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Slow Time artefacts worked like a spell. All enemies and creatures in the area moved at a quarter of their normal speed for a limited time.  {{entity_item_behavior}}  {{entity...&quot;</comment>
      <text xml:space="preserve" bytes="330">Slow Time artefacts worked like a spell. All enemies and creatures in the area moved at a quarter of their normal speed for a limited time.

{{entity_item_behavior}}

{{entity_fields}}
{{entity_item_fields}}
{{entity_common_fields|classname=item_slowtime}}
{{entity_fields_end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>797</id>
      <timestamp>2012-07-16T09:04:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="163">Slow Time artefacts worked like a spell. All enemies and creatures in the area moved at a quarter of their normal speed for a limited time.

{{entity item common}}</text>
    </revision>
    <revision>
      <id>2318</id>
      <timestamp>2012-07-30T21:59:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="176">Slow Time artefacts worked like a spell. All enemies and creatures in the area moved at a quarter of their normal speed for a limited time.

{{entity item common}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Item(entity)</title>
    <ns>0</ns>
    <id>665</id>
      <sha1>8omes4srruovw5q002k3wdrt21z3b1u</sha1>
    <revision>
      <id>3695</id>
      <timestamp>2014-05-15T20:42:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.  == Behavior == When item is targeted by another [[entity...&quot;</comment>
      <text xml:space="preserve" bytes="976">Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.

== Behavior ==
When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle spawn move (as it spawns from chest), target it to some entity, then it will start it's move from that entity center (so you can target [[BModel | bmodels]]).

Item will [[trigger event | trigger]] it's targets once picked it when picked.

=== Call parameters ===

Items have no special calling parameters.

=== Keys ===

{{entity fields begin}}
|-
| Target
| target
| This entity will be triggered when item is picked. Also this entity will be a start position for circle spawn move.
|-
| Target parameters
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered.
{{entity fields end}}</text>
    </revision>
    <revision>
      <id>3696</id>
      <timestamp>2014-05-15T20:42:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1028">Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.

== Behavior ==
When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle spawn move (as it spawns from chest), target it to some entity, then it will start it's move from that entity center (so you can target [[BModel | bmodels]]).

Item will [[trigger event | trigger]] it's targets once picked it when picked.

=== Call parameters ===

Items have no special calling parameters.

=== Keys ===

{{entity fields begin}}
|-
| Target
| target
| This entity will be triggered when item is picked. Also this entity will be a start position for circle spawn move.
|-
| Target parameters
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered.
{{entity fields end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>3697</id>
      <timestamp>2014-05-15T20:43:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1013">Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.

== Behavior ==
When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle spawn move (as it spawns from chest), target it to some entity, then it will start it's move from that entity center (so you can target [[BModel | bmodels]]).

Item will [[trigger event | trigger]] it's targets once picked.

=== Call parameters ===

Items have no special calling parameters.

=== Keys ===

{{entity fields begin}}
|-
| Target
| target
| This entity will be triggered when item is picked. Also this entity will be a start position for circle spawn move.
|-
| Target parameters
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered.
{{entity fields end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>3698</id>
      <timestamp>2014-05-15T20:43:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1006">Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.

== Behavior ==
When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle spawn move (as it spawns from chest), target it to some entity, then it will start it's move from that entity center (so you can target [[BModel | bmodels]]).

Item will [[trigger event | trigger]] it's targets once picked.

=== Call parameters ===

Items have no specific parameters.

=== Keys ===

{{entity fields begin}}
|-
| Target
| target
| This entity will be triggered when item is picked. Also this entity will be a start position for circle spawn move.
|-
| Target parameters
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered.
{{entity fields end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>3699</id>
      <timestamp>2014-05-15T20:43:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1001">Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.

== Behavior ==
When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle spawn move (as it spawns from chest), target it to some entity, then it will start it's move from that entity center (so you can target [[BModel | bmodels]]).

Item will [[trigger event | trigger]] it's targets once picked.

=== Call parameters ===

Items have no specific parameters.

=== Keys ===

{{entity fields begin}}
|-
| Target
| target
| This entity will be triggered when item is picked. Also this entity will be a start position for circle spawn move.
|-
| Target parms
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered.
{{entity fields end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
    <revision>
      <id>3700</id>
      <timestamp>2014-05-15T20:45:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1156">Blood Omnicide item archetype is used to create items such as: artifacts, spell cards, weapons, powerups, tokens etc.

== Behavior ==
When item is targeted by another [[entity]], it becomes hidden and spawns itself when called. 

To make item animate using circle spawn move (as it spawns from chest), target it to some entity, then it will start it's move from that entity center (so you can target [[BModel | bmodels]]).

Item will [[trigger event | trigger]] it's targets once picked.

=== Call parameters ===

Items have no specific parameters.

=== Keys ===

{{entity fields begin}}
|-
| Target
| target
| This entity will be triggered when item is picked. Also this entity will be a start position for circle spawn move.
|-
| Target parms
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered.
|-
| Classname
| classname
| Set's a particular entity class.
|-
| SaveId
| sid
| Must be set. A SaveID used to keep item state (hidden, spawned, picked).
{{entity fields end}}

[[Category:Entity definitions]]
[[Category:Items]]</text>
    </revision>
  </page>
  <page>
    <title>Lightgrid</title>
    <ns>0</ns>
    <id>139</id>
      <sha1>r52cwqbyoweq8fv9cf2hhx3ggra95o9</sha1>
    <revision>
      <id>1740</id>
      <timestamp>2012-07-24T08:44:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during LIGHT phase each time map is compiled.  Each cell of ...&quot;</comment>
      <text xml:space="preserve" bytes="591">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during LIGHT phase each time map is compiled.

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Diffuse light vector

When rendered, model sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.</text>
    </revision>
    <revision>
      <id>1741</id>
      <timestamp>2012-07-24T08:44:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="583">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during LIGHT phase each time map is compiled.

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Light vector

When rendered, model sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.</text>
    </revision>
    <revision>
      <id>1742</id>
      <timestamp>2012-07-24T08:59:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1365">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during LIGHT phase each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Light vector

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

== Level Design Notes ==

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.

Often map bounds is much bigger than the space players and NPC can walk on. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

Sometimes lightgrid is more bright or darker that the rest of environments, this makes entities to look out of the place. In order to make lightgrid match environments corrections should be made in a [[map build script]]. There is 2 coefficients to fix lightgrid: diffuse scale (scales intensity of diffise lightgrid component) and ambient scale (scales ambient RGB component).

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1743</id>
      <timestamp>2012-07-24T08:59:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1371">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during LIGHT phase each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Light vector

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

== Level Design Notes ==

* Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.

* Often map bounds is much bigger than the space players and NPC can walk on. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

* Sometimes lightgrid is more bright or darker that the rest of environments, this makes entities to look out of the place. In order to make lightgrid match environments corrections should be made in a [[map build script]]. There is 2 coefficients to fix lightgrid: diffuse scale (scales intensity of diffise lightgrid component) and ambient scale (scales ambient RGB component).

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1744</id>
      <timestamp>2012-07-24T08:59:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1373">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during LIGHT phase each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Light vector

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

=== Level Design Notes ===

* Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.

* Often map bounds is much bigger than the space players and NPC can walk on. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

* Sometimes lightgrid is more bright or darker that the rest of environments, this makes entities to look out of the place. In order to make lightgrid match environments corrections should be made in a [[map build script]]. There is 2 coefficients to fix lightgrid: diffuse scale (scales intensity of diffise lightgrid component) and ambient scale (scales ambient RGB component).

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1745</id>
      <timestamp>2012-07-24T09:00:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1377">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Light vector

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

=== Level Design Notes ===

* Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.

* Often map bounds is much bigger than the space players and NPC can walk on. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

* Sometimes lightgrid is more bright or darker that the rest of environments, this makes entities to look out of the place. In order to make lightgrid match environments corrections should be made in a [[map build script]]. There is 2 coefficients to fix lightgrid: diffuse scale (scales intensity of diffise lightgrid component) and ambient scale (scales ambient RGB component).

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1746</id>
      <timestamp>2012-07-24T09:01:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level Design Notes */</comment>
      <text xml:space="preserve" bytes="1378">Lightgrid or volumeric lighting - a data structure used to store static lighting for models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient light RGB
* Diffuse light RGB
* Light vector

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse lighting to be applied during shading.

=== Level Design Notes ===

* Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'.

* Often map bounds is much bigger than the space players and NPC can walk on. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

* Sometimes lightgrid is more bright or darker that the rest of environments, this makes entities to look out of the place. In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: diffuse scale (scales intensity of diffise lightgrid component) and ambient scale (scales ambient RGB component).

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1747</id>
      <timestamp>2012-07-24T09:16:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1922">Lightgrid or volumeric lighting - a data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Diffuse RGB
* Average light vector (used for diffuse lighting)

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright is lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from the lightgrid bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1748</id>
      <timestamp>2012-07-24T09:17:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1906">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright is lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from the lightgrid bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1749</id>
      <timestamp>2012-07-24T09:18:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* How it works */</comment>
      <text xml:space="preserve" bytes="1919">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright is, by default, lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from the lightgrid bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1750</id>
      <timestamp>2012-07-24T09:19:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1910">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright is, by default, lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; worldspawn key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1751</id>
      <timestamp>2012-07-24T09:19:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1914">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and find average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright is, by default, lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1772</id>
      <timestamp>2012-07-24T09:48:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* How it works */</comment>
      <text xml:space="preserve" bytes="1913">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright is, by default, lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1773</id>
      <timestamp>2012-07-24T09:48:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* How it works */</comment>
      <text xml:space="preserve" bytes="1914">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: does not work on some Blood Omnicide locations).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1777</id>
      <timestamp>2012-07-25T10:38:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Console variables */</comment>
      <text xml:space="preserve" bytes="1971">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

=== How it works ===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

=== Resolution ===

Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

'''IMPORTANT NOTE''': Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

=== Corrections ===

Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

== Console variables ==

* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).
* r_fullbright - disables static lighting.

== See also ==
* [[Lightmap]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1843</id>
      <timestamp>2012-07-26T16:31:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1960">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

===How it works===

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

===Resolution===
Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

{{important|Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.}}

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

===Corrections===
Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

==Console variables==
* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).
* r_fullbright - disables static lighting.

==See also==
* [[Lightmap]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1857</id>
      <timestamp>2012-07-26T16:38:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1966">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

====How it works====

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

====Resolution====
Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

{{important|Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.}}

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

====Corrections====
Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

==Console variables==
* r_ambient - adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).
* r_fullbright - disables static lighting.

==See also==
* [[Lightmap]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1951</id>
      <timestamp>2012-07-27T11:06:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2101">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

====How it works====

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

====Resolution====
Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

{{important|Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.}}

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

====Corrections====
Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Vertex lighting]]
* [[Realtime lighting]]

[[Category:Glossary]]
[[Category:Darkplaces engine]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1954</id>
      <timestamp>2012-07-27T11:09:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2077">A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

====How it works====

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

====Resolution====
Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

{{important|Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.}}

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

====Corrections====
Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Vertex lighting]]

[[Category:Glossary]]
[[Category:Darkplaces engine]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2274</id>
      <timestamp>2012-07-30T20:40:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2110">{{need screenshot}}
A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

====How it works====

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

====Resolution====
Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

{{important|Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.}}

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

====Corrections====
Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Vertex lighting]]

[[Category:Glossary]]
[[Category:Darkplaces engine]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2276</id>
      <timestamp>2012-07-30T20:41:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2122">{{need screenshot}}
{{grammar}}
A three-dimensional data structure used to store static lighting on models. Lightgrid are created during [[LIGHT phase]] each time map is compiled.

====How it works====

Each cell of lightgrid stores this information:
* Ambient RGB
* Average light vector (used for diffuse lighting)
* Diffuse RGB

When rendered, entity sample it's position at lightgrid and get average ambient and diffuse components to be applied during shading. Any entity that doesnt use lightmaps and not fullbright, is, by default, lit with lightgrid.

====Resolution====
Lightgrid resolution on a particular map comes from it's bounds and cell size.

Default lightgrid cell size in game units is '64 64 128'. It can be customized with &quot;gridsize&quot; [[worldspawn]] key. Most of Blood Omnicide maps using lightgrid size '32 32 32' or '32 32 64'. 

{{important|Do not use too small cell size because amount on memory and time it takes to calculate grows geometrically.}}

Often map bounds is much bigger than the space players and NPC can walk in. To not waste memory and reduce map compile time, level designer should place a brush covered by [[Common materials | common/lightgrid]] material. That brush will set the area where lightgrid will be calculated and applied.

====Corrections====
Sometimes lightgrid is lighter or darker that the rest of environments which makes entities to look out of the place. 

In order to make lightgrid match environments, a corrections should be made in a [[map build script]]. There is two coefficients to mess with: 
* diffuse scale: scales intensity of diffise lightgrid component
* ambient scale: scales ambient RGB component

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Vertex lighting]]

[[Category:Glossary]]
[[Category:Darkplaces engine]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Lightmap</title>
    <ns>0</ns>
    <id>138</id>
      <sha1>ex799i1coxleaao4m0n5igp5dbu7hqq</sha1>
    <revision>
      <id>1737</id>
      <timestamp>2012-07-23T12:25:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{article unfinished}}  [[File:Lightmap deluxemap.jpg|256px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]&quot;</comment>
      <text xml:space="preserve" bytes="125">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|256px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]</text>
    </revision>
    <revision>
      <id>1738</id>
      <timestamp>2012-07-23T12:25:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="131">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]</text>
    </revision>
    <revision>
      <id>1786</id>
      <timestamp>2012-07-26T11:03:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>initial version</comment>
      <text xml:space="preserve" bytes="1526">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

== Lightmap resolution ==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution for particular surface:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

== Deluxemapping ==
In Blood Omnicide, lightmaps comes with model-space deluxemaps, which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.</text>
    </revision>
    <revision>
      <id>1787</id>
      <timestamp>2012-07-26T11:04:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1585">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution for particular surface:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with model-space deluxemaps, which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1788</id>
      <timestamp>2012-07-26T11:04:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap resolution */</comment>
      <text xml:space="preserve" bytes="1591">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution for particular surface:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with model-space deluxemaps, which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1791</id>
      <timestamp>2012-07-26T11:41:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap resolution */</comment>
      <text xml:space="preserve" bytes="1568">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap of the Kain's mausoleum (deluxemap of the right)]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with model-space deluxemaps, which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1792</id>
      <timestamp>2012-07-26T12:08:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1557">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with model-space deluxemaps, which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1793</id>
      <timestamp>2012-07-26T12:09:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap resolution */</comment>
      <text xml:space="preserve" bytes="1587">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with model-space deluxemaps, which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1794</id>
      <timestamp>2012-07-26T13:02:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Added info about lightmap types and quirks</comment>
      <text xml:space="preserve" bytes="3261">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;.

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:'''There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does ot, otherwise it adds a second and more lightmap pages to fit.

==Design==
Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide variantion of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it.

==Quirks==
There is much of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and applying a fixes afterwards.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1795</id>
      <timestamp>2012-07-26T13:02:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3265">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;.

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:'''There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Design==
Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide variantion of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it.

==Quirks==
There is much of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and applying a fixes afterwards.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1796</id>
      <timestamp>2012-07-26T13:03:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>fix typo</comment>
      <text xml:space="preserve" bytes="3266">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:'''There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Design==
Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide variantion of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it.

==Quirks==
There is much of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and applying a fixes afterwards.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1797</id>
      <timestamp>2012-07-26T13:04:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap types */</comment>
      <text xml:space="preserve" bytes="3267">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Design==
Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide variantion of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it.

==Quirks==
There is much of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and applying a fixes afterwards.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1798</id>
      <timestamp>2012-07-26T13:06:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3271">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Making good Lightmaps==
Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide variantion of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it.

There is much of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and applying a fixes afterwards.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1799</id>
      <timestamp>2012-07-26T13:06:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Making good Lightmaps */</comment>
      <text xml:space="preserve" bytes="2713">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Making good Lightmaps==

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1800</id>
      <timestamp>2012-07-26T13:06:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3245">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide variantion of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it.

There is much of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and applying a fixes afterwards.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1801</id>
      <timestamp>2012-07-26T13:08:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3254">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color.

Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1802</id>
      <timestamp>2012-07-26T13:08:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3253">{{article unfinished}}

[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1890</id>
      <timestamp>2012-07-26T17:43:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3229">[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

'''NOTE:''' There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1891</id>
      <timestamp>2012-07-26T17:45:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Lightmap types */</comment>
      <text xml:space="preserve" bytes="3217">[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Lightgrid]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1953</id>
      <timestamp>2012-07-27T11:09:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3265">[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Glossary]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1956</id>
      <timestamp>2012-07-27T11:10:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3318">[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1957</id>
      <timestamp>2012-07-27T11:10:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3598">[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2252</id>
      <timestamp>2012-07-30T20:27:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3606">{{wip}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2253</id>
      <timestamp>2012-07-30T20:27:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3606">{{WIP}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2265</id>
      <timestamp>2012-07-30T20:33:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3598">[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2275</id>
      <timestamp>2012-07-30T20:41:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3623">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely lit levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
In Blood Omnicide, lightmaps comes with interleaved deluxemaps (evens are lightmaps, odds are deluxemaps), which store light directions. This allows for per-pixel lightning effects (such as bumps and gloss) to be rendered for static lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps are 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap. However, for practical reasons (saving HDD space), often there is 2 external lightmaps or many internal ones (to not mess up maps with many directories).

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Lightgrid]]
* [[Vertex lighting]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2512</id>
      <timestamp>2012-08-09T07:49:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3467">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture to simulate lighting. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In Bloods Omnicide, lightmaps can only store static lightning, no flickering or moving lights (for this ones, [[realtime lighting | dynamic lightsources ]] should be used).

Most part of level lit by lightmaps, only some small places using dynamic lighting. Good map lighting should have wide rande of colors and nicely placed lights that cast correct shadows. Its a good rule to use lightmap to not only light up a level, but add some details to it. There is a bunch of delicate things when working with lightmaps. Good lightmaps are small, looking effective and have no visible artifacts. Basically there is no rules to make a good lightmaps with a first try. It always needs an eye inspection and some practice to make nicely illuminated levels.

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more memory overhead. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
Deluxemaps are part of lightmaps, while lightmaps store light intensity, deluxemaps store light vectors. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Vertex lighting]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2513</id>
      <timestamp>2012-08-09T07:54:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2891">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In [[Q3BSP]], lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lightmap_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Vertex lighting]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2720</id>
      <timestamp>2012-10-07T10:54:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Lightmap types */</comment>
      <text xml:space="preserve" bytes="2885">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In [[Q3BSP]], lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lm_&lt;num&gt;).

Map build script are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Vertex lighting]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2721</id>
      <timestamp>2012-10-07T10:54:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2906">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In [[Q3BSP]], lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lm_&lt;num&gt;).

[[map build script|Map build script]] are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Vertex lighting]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3608</id>
      <timestamp>2013-02-20T19:10:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3575">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In [[Q3BSP]], lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lm_&lt;num&gt;).

[[map build script|Map build script]] are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

== Usage of lightmaps ==
{| cellspacing=0 cellpadding=2 width=900
| width:50% align=right | Small objects:
| width:50% | &lt;font color=orange&gt;Require high-resolution lightmaps or artifacts will occur&lt;/font&gt;
|-
| align=right | Foliage (grass, mushrooms, many-side brushes etc.): 
| &lt;font color=orange&gt;Likely to overwhelm map size, as each object adds to lightmap data&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[Radiant/Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Vertex lighting]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3609</id>
      <timestamp>2013-02-20T19:10:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Usage of lightmaps */</comment>
      <text xml:space="preserve" bytes="3556">{{grammar}}
[[File:Lightmap deluxemap.jpg|thumb|512px|right|Lightmap and Deluxemap of the Kain's mausoleum]]

Lightmap is generated texture that contains brightness of a map surface. It is applied additively to the surface texture. The color values of surface's texture get multiplied by lightmap color. Lightmaps are created each time map is compiled (by a LIGHT phase of the map compiler). In [[Q3BSP]], lightmaps can only store static lightning, no flickering or moving lights (for this ones dynamic lights should be used).

==Lightmap resolution==

Lightmap resolution is different from the [[texture]] resolution. Default luxel (lightmap pixel) size is 8 game units. Higher lightmap resolution = lower luxel scale = more details = more memory used. There is a bunch of ways to control lightmap resolution:

* Global luxel scale (set in [[map build script]])
* Entity's &quot;_ls&quot; or &quot;_lightmapscale&quot; field (works on [[func_group]] too)
* Material's q3map_lightmapSampleSize (alters default luxel size for this material)

Lowering luxel scale will make lightmap shadows sharper, but leads to larger map filesize, slightly slower rendering and exponentially slower compiles (that at very low scales start to eat up shocking amounts of system memory).

==Deluxemapping==
Deluxemaps are optional part of lightmaps, while lightmaps store light intensity, deluxemaps store light directions. Deluxemaps allows lightmapped surfaces to have normalmapping and specular effect applied, effectively making them more detailed and look just like dynamic lighting.

==Lightmap types==
There are two types of lightmaps - internal and external. Internal lightmaps are 128x128 pixel pages that are stored inside [[BSP (file) | BSP file]]. External lightmaps is 24-bit [[TGA]] images stored outside of BSP file (in map/bspfilename/lm_&lt;num&gt;).

[[map build script|Map build script]] are used to configure whether map should use internal or external lightmaps.

External lightmaps have an advantage - they can be any size (256x256, 512x512, 1024x1024 and up to hardware limits). For big outdoor maps using external large lightmaps results in better packing and lesser map size. Ideally, one map should have exactly one big external lightmap.

There is no way to set explicitly what number of lightmaps map will have, it's calculated automatically - if map luxels can be mapped to one lightmap - compiler does it, otherwise it adds a second and more lightmap pages to fit.

== Usage of lightmaps ==
{| cellspacing=0 cellpadding=2 width=900
| width:50% align=right | Small objects:
| width:50% | &lt;font color=orange&gt;Require high-resolution lightmaps or artifacts will occur&lt;/font&gt;
|-
| align=right | Foliage (grass, mushrooms etc.): 
| &lt;font color=orange&gt;Likely to overwhelm map size, as each object adds to lightmap data&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[Radiant/Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

==Console variables==
{{cvar|r_ambient|adds intensity to lightmap and lightgrid. Positive values makes map brighter (note: manual edit of this cvar via console does not work in Blood Omnicide, as cvar is controlled by gamecode).}}
{{cvar|r_fullbright|disables static lighting.}}

==See also==
* [[Darkplaces lighting]]
* [[Vertex lighting]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>MD3</title>
    <ns>0</ns>
    <id>176</id>
      <sha1>qgyqtpd9ntbfn6vimcvxyp9p1974apc</sha1>
    <revision>
      <id>2043</id>
      <timestamp>2012-07-27T15:25:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}}  MD3 is a model format developed by id software. It is used by the Quake 3 engine as well as its many successors and other game engines including Darkplaces.   ...&quot;</comment>
      <text xml:space="preserve" bytes="1158">{{unfinished}}

MD3 is a model format developed by id software. It is used by the Quake 3 engine as well as its many successors and other game engines including Darkplaces. 

The format is used mostly for player/NPC models and [[misc_gamemodel | non-structural geometry]] although it may be used for [[misc_model| structural uses]].

In Blood Omnicice, MD3 is general format used for non-animated models.

==Features==
* Vertex-based animation
* Multiple surfaces (meshes) per model
* Float precision for vertices (almost no wobbling)
* Can support a very high amount of triangles.
* Support tags (volumeless vectors) which is light form of bones and used to attach together separate models and mark positions.

==Limits==
* Max 65536 vertices
* Max 32768 triangles
* Max 65536 frames
* Max 256 meshes
* Max 256 [[skin | skins]]
* Vertex normals are stored as pair of byte angles (pitch and yaw)
* Not supporting smoothing groups (to simulate SG, mesh should be shopped in a parts)

== Importers ==
* 3D Studio max MD3 import mesh script

== Exporters ==
* [[MD3 Compiler]]
* [[Darkplaces MD3 Exporter for 3D Studio MAX]]

[[Category:File formats]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2583</id>
      <timestamp>2012-08-09T15:24:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1283">{{unfinished}}

MD3 is a model format developed by id software. It is used by the Quake 3 engine as well as its many successors and other game engines including Darkplaces. 

The format is used mostly for player/NPC models and [[misc_gamemodel | non-structural geometry]] although it may be used for [[misc_model| structural uses]].

In Blood Omnicice, MD3 is general format used for non-animated models.

==Features==
* Vertex-based animation
* Multiple surfaces (meshes) per model
* Float precision for vertices (almost no wobbling)
* Can support a very high amount of triangles.
* Support tags (volumeless vectors) which is light form of bones and used to attach together separate models and mark positions.

==Limits==
* Max 65536 vertices
* Max 32768 triangles
* Max 65536 frames
* Max 256 meshes
* Max 256 [[skin | skins]]
* Vertex normals are stored as pair of byte angles (pitch and yaw)
* Not supporting smoothing groups (to simulate SG, mesh should be shopped in a parts)

== Importers ==
* 3D Studio max MD3 import mesh script

== Exporters ==
* [[MD3 Compiler]]
* [[Darkplaces MD3 Exporter for 3D Studio MAX]]

==Tutorials==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

[[Category:File formats]]
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>MD3 Compiler</title>
    <ns>0</ns>
    <id>191</id>
      <sha1>9whldg2r2k8qn48qwbdbon969huiiao</sha1>
    <revision>
      <id>2329</id>
      <timestamp>2012-08-01T08:12:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.  ==Features==  * Loading MD3, [[ASE]], 3DS files * Exporting MD3 * Inspectino of model s...&quot;</comment>
      <text xml:space="preserve" bytes="697">NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* Loading MD3, [[ASE]], 3DS files
* Exporting MD3
* Inspectino of model structure (surfaces, msterials, shading, frames, tags)
* Altering material assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]</text>
    </revision>
    <revision>
      <id>2330</id>
      <timestamp>2012-08-01T08:17:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="732">{{unfinished}}
{{need screenshot}}
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* Loading MD3, [[ASE]], 3DS files
* Exporting MD3
* Inspectino of model structure (surfaces, msterials, shading, frames, tags)
* Altering material assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]</text>
    </revision>
    <revision>
      <id>2346</id>
      <timestamp>2012-08-01T09:30:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="784">{{grammar}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* Loading MD3, [[ASE]], 3DS files
* Exporting MD3
* Inspection of model structure (surfaces, msterials, shading, frames, tags)
* Altering material assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2347</id>
      <timestamp>2012-08-01T09:31:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="911">{{grammar}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* Loading MD3, [[ASE]], 3DS files
* Exporting MD3
* Inspection of model structure (surfaces, msterials, shading, frames, tags)
* Altering material assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a skin-path using Npherno MD3 Compiler|Altering a skin-path using Npherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2348</id>
      <timestamp>2012-08-01T09:32:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="909">{{grammar}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* Loading MD3, [[ASE]], 3DS files
* Exporting MD3
* Inspection of model structure (surfaces, msterials, shading, frames, tags)
* Altering material assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a material using Npherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2351</id>
      <timestamp>2012-08-01T09:32:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="909">{{grammar}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* Loading MD3, [[ASE]], 3DS files
* Exporting MD3
* Inspection of model structure (surfaces, msterials, shading, frames, tags)
* Altering material assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2379</id>
      <timestamp>2012-08-02T14:27:24Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Features */</comment>
      <text xml:space="preserve" bytes="907">{{grammar}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* MD3, [[ASE]], 3DS files support
* Export as MD3
* Inspection of model structure (surfaces, materials, shading, frames, tags)
* Alter materials assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes arent saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, should rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2380</id>
      <timestamp>2012-08-02T14:28:26Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <minor/>
      <comment>/* Known bugs */</comment>
      <text xml:space="preserve" bytes="907">{{grammar}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* MD3, [[ASE]], 3DS files support
* Export as MD3
* Inspection of model structure (surfaces, materials, shading, frames, tags)
* Alter materials assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes are not saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, must rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2697</id>
      <timestamp>2012-09-28T13:13:01Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="921">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* MD3, [[ASE]], 3DS files support
* Export as MD3
* Inspection of model structure (surfaces, materials, shading, frames, tags)
* Alter materials assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes are not saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, must rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2904</id>
      <timestamp>2012-11-23T01:21:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="931">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
NPherno's MD3 Compiler is a small but useful tool to preview and tweak [[MD3]] models.

==Features== 
* MD3, [[ASE]], 3DS files support
* Export as MD3
* Inspection of model structure (surfaces, materials, shading, frames, tags)
* Alter materials assigned to surface
* Remove selected frame/surface
* Rebuild normals using UV seams or smooth mode

==Known bugs==
{{bug|When altering surface material or name, changes are not saved until some another surface is selected. To apply changes click on dropbox and select some surface.}}
{{bug|Normals are not loaded for ASE and 3DS, must rebuild them.}}

==Tutorials==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
      <sha1>lg8kc9k8uzncpgh3k3vri78imvoxc6m</sha1>
    <revision>
      <id>1</id>
      <timestamp>2012-07-02T11:36:39Z</timestamp>
      <contributor>
        <username>MediaWiki default</username>
        <id>0</id>
      </contributor>
      <text xml:space="preserve" bytes="423">'''MediaWiki has been successfully installed.'''

Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.

== Getting started ==
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]</text>
    </revision>
    <revision>
      <id>2</id>
      <timestamp>2012-07-02T11:45:23Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Getting started */</comment>
      <text xml:space="preserve" bytes="160">'''MediaWiki has been successfully installed.'''

Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.</text>
    </revision>
    <revision>
      <id>3</id>
      <timestamp>2012-07-02T11:45:38Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>4</id>
      <timestamp>2012-07-02T11:50:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3">'V'</text>
    </revision>
    <revision>
      <id>5</id>
      <timestamp>2012-07-02T11:50:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="7">'''V'''</text>
    </revision>
    <revision>
      <id>6</id>
      <timestamp>2012-07-02T11:52:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>Reverted edits by [[Special:Contributions/VorteX|VorteX]] ([[User talk:VorteX|talk]]) to last revision by [[User:212.232.33.42|212.232.33.42]]</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>7</id>
      <timestamp>2012-07-02T12:07:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="39">''''Blood Omnicide Development Wiki''''</text>
    </revision>
    <revision>
      <id>8</id>
      <timestamp>2012-07-02T12:08:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="39">=== Blood Omnicide Development Wiki ===</text>
    </revision>
    <revision>
      <id>9</id>
      <timestamp>2012-07-02T12:26:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="543">== Topics ==
'''General'''
Most common information and frequently asked questions
'''Engine'''
Documents concerning usage of Darkplaces engine
'''Decorator'''
Information to work with Decorator - Blood Omnicide ingame editor
'''NetRadiant'''
Documents concerning NetRadiant - Blood Omnicide level editor
'''Modelling'''
Documents and topics about modelling, model formats and engine tricks
'''Scripting'''
Game scripts editing (not QuakeC)
'''Texture'''
Topics about textures, supported texture formats
'''Tools'''
Special Blood Omnicide tools</text>
    </revision>
    <revision>
      <id>10</id>
      <timestamp>2012-07-02T12:29:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Topics */</comment>
      <text xml:space="preserve" bytes="589">== Topics ==
'''General'''

:Most common information and frequently asked questions

'''Engine'''

:Documents concerning usage of Darkplaces engine

'''[[Decorator]]'''

:Information to work with Decorator - Blood Omnicide ingame editor

'''[[NetRadiant]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Tools]]'''

:Special Blood Omnicide tools</text>
    </revision>
    <revision>
      <id>11</id>
      <timestamp>2012-07-02T12:30:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Topics */</comment>
      <text xml:space="preserve" bytes="617">== Development Topics ==
'''[[General Editing]]'''

:Most common information and frequently asked questions

'''[[Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Decorator]]'''

:Information to work with Decorator - Blood Omnicide ingame editor

'''[[NetRadiant]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Tools]]'''

:Special Blood Omnicide tools</text>
    </revision>
    <revision>
      <id>12</id>
      <timestamp>2012-07-02T12:45:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1290">{| border=1 cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>13</id>
      <timestamp>2012-07-02T12:51:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1318">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>39</id>
      <timestamp>2012-07-02T14:42:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Topics */</comment>
      <text xml:space="preserve" bytes="1319">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

:'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>40</id>
      <timestamp>2012-07-02T14:43:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General Topics */</comment>
      <text xml:space="preserve" bytes="1318">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>144</id>
      <timestamp>2012-07-02T19:28:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1420">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>145</id>
      <timestamp>2012-07-02T19:29:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1423">{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

-

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>146</id>
      <timestamp>2012-07-02T19:29:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1425">Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

---

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>147</id>
      <timestamp>2012-07-02T19:29:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1427">Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.

-----

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>148</id>
      <timestamp>2012-07-02T19:30:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1444">&lt;center&gt;Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.&lt;/center&gt;

-----

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>149</id>
      <timestamp>2012-07-02T19:30:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1466">&lt;center&gt;&lt;font size=&quot;4&quot;&gt;Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.&lt;/font&gt;&lt;/center&gt;

-----

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>150</id>
      <timestamp>2012-07-02T19:31:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1505">

&lt;center&gt;&lt;font size=&quot;6&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki, so it contains alot of spoilers on storyline, secrets and cheats.&lt;/font&gt;&lt;/center&gt;


-----


{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>151</id>
      <timestamp>2012-07-02T19:31:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1505">

&lt;center&gt;&lt;font size=&quot;6&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki

so it contains alot of spoilers on storyline, secrets and cheats.&lt;/font&gt;&lt;/center&gt;


-----


{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>152</id>
      <timestamp>2012-07-02T19:32:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1573">

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki&lt;/font&gt;&lt;/center&gt;

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;It contains alot of spoilers on storyline and game secrets.&lt;/font&gt;&lt;/center&gt;


-----


{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}</text>
    </revision>
    <revision>
      <id>153</id>
      <timestamp>2012-07-02T19:32:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1593">

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;Warning! This is Development Wiki&lt;/font&gt;&lt;/center&gt;

&lt;center&gt;&lt;font size=&quot;5&quot; style=&quot;color:red;font-weight:bold&quot;&gt;It contains alot of spoilers on storyline and game secrets.&lt;/font&gt;&lt;/center&gt;


-----

&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>154</id>
      <timestamp>2012-07-02T19:33:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;


-----

&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>155</id>
      <timestamp>2012-07-02T19:33:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1439">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>156</id>
      <timestamp>2012-07-02T19:33:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1456">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 75%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

 | valign=top |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>157</id>
      <timestamp>2012-07-02T19:34:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1524">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top width=33% style=&quot;border-right: 1px solid #DDD&quot; |

 | valign=top width=33% style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top width=33% |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>158</id>
      <timestamp>2012-07-02T19:34:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1460">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top width=33% style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top width=33% |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>160</id>
      <timestamp>2012-07-02T19:41:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1460">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top width=15% style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top width=33% |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>161</id>
      <timestamp>2012-07-02T19:41:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1440">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>216</id>
      <timestamp>2012-07-03T06:18:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1498">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

== Blood Omnicide .Plan ==
'''[[Levels]]'''
:Level sheme

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>218</id>
      <timestamp>2012-07-03T06:21:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide .Plan */</comment>
      <text xml:space="preserve" bytes="1514">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

== Blood Omnicide .Plan ==
* '''[[Music themes]]'''
* '''[[All maps]]'''

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>219</id>
      <timestamp>2012-07-03T06:28:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide .Plan */</comment>
      <text xml:space="preserve" bytes="1566">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

== Blood Omnicide .Plan ==
* '''[[Blood Omnicide Music Themes | Music themes]]'''
* '''[[Blood Omnicide Maps | All maps]]'''

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>220</id>
      <timestamp>2012-07-03T06:29:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1440">

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;



&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>224</id>
      <timestamp>2012-07-03T06:31:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1436">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;center&gt;&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;&lt;/center&gt;

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>225</id>
      <timestamp>2012-07-03T06:31:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1419">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>226</id>
      <timestamp>2012-07-03T06:31:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1437">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;

== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>227</id>
      <timestamp>2012-07-03T06:31:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1438">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''[[Scripting]]'''

:Game scripts editing (not QuakeC)

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>228</id>
      <timestamp>2012-07-03T06:44:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1442">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

Game scripts editing

* [[Pattern script]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>229</id>
      <timestamp>2012-07-03T06:44:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1460">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

Game scripts editing

* [[Pattern scripts | Pattern script]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>230</id>
      <timestamp>2012-07-03T06:44:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1460">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

Game scripts editing

* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>231</id>
      <timestamp>2012-07-03T06:44:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1466">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''Game scripts editing'''

* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>233</id>
      <timestamp>2012-07-03T06:56:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1485">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''[[Translating]]'''

:Translating Blood Omnicide to other languages

'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>254</id>
      <timestamp>2012-07-03T07:51:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1504">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

:Common editing information, workflows and terminology

'''[[Darkplaces Engine]]'''

:Documents concerning usage of Darkplaces engine

'''[[Level Editing]]'''

:Documents concerning NetRadiant - Blood Omnicide level editor

'''[[Decorating]]'''

:Information to work with Decorator - Blood Omnicide built-in editor

'''[[Modelling]]'''

:Documents and topics about modelling, model formats and engine tricks

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''[[Texture]]'''
:Topics about textures, supported texture formats

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]



'''[[Tools]]'''

:Special Blood Omnicide tools

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>255</id>
      <timestamp>2012-07-03T07:54:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1190">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine''
* [[Material system]]
* [[Virtual file system]]

'''Level editing'''

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>256</id>
      <timestamp>2012-07-03T07:55:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1191">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine''
* [[Material system]]
* [[Virtual file system]]

'''Level editing'''

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>257</id>
      <timestamp>2012-07-03T07:55:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1270">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''

'''Game scripts editing'''

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>258</id>
      <timestamp>2012-07-03T07:56:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1295">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==
'''[[General Editing]]'''

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Tutorials]]

* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Call event]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>259</id>
      <timestamp>2012-07-03T07:58:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1421">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>260</id>
      <timestamp>2012-07-03T07:59:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1422">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>261</id>
      <timestamp>2012-07-03T07:59:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1422">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

===Darkplaces engine===
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>262</id>
      <timestamp>2012-07-03T07:59:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1422">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

'''Darkplaces engine'''
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>263</id>
      <timestamp>2012-07-03T07:59:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1424">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine====
* [[Material system]]
* [[Virtual file system]]

'''Modelling'''
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

'''Level editing'''
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

'''Script reference'''
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

'''Translating Blood Omnicide to other languages'''

* [[Translation packs reference]]

'''Tools &amp; Stuff'''

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>264</id>
      <timestamp>2012-07-03T08:00:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1442">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages===

* [[Translation packs reference]]

===Tools &amp; Stuff===

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>265</id>
      <timestamp>2012-07-03T08:01:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;</text>
    </revision>
    <revision>
      <id>266</id>
      <timestamp>2012-07-03T08:02:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1456">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;


== General Topics ==

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>267</id>
      <timestamp>2012-07-03T08:03:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1433">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;

'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>268</id>
      <timestamp>2012-07-03T08:03:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1435">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>269</id>
      <timestamp>2012-07-03T08:03:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=40% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



'''[[Blood Omnicide project]]'''
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>270</id>
      <timestamp>2012-07-03T08:03:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1441">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=[[Blood Omnicide project]]=
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>271</id>
      <timestamp>2012-07-03T08:04:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1443">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



==[[Blood Omnicide project]]==
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>272</id>
      <timestamp>2012-07-03T08:04:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



===[[Blood Omnicide project]]===
:Most common information and frequently asked questions

'''[[Bloody Sounds project]]'''
:A sub-project to improve Blood omen soundtrack

'''[[Distinct Chronicles project]]'''
:A sub-project to improve Blood omen cinematics

'''[[Nosgoth]]'''
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

'''[[Gameplay]]'''
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>273</id>
      <timestamp>2012-07-03T08:04:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1445">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



===[[Blood Omnicide project]]===
:Most common information and frequently asked questions

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>274</id>
      <timestamp>2012-07-03T08:07:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1529">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
 Features
 Blood Omnicide Codex
 Project: Bloody Sounds
 Project: Distinct Chronicles
:Most common information and frequently asked questions

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>275</id>
      <timestamp>2012-07-03T08:07:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1533">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
:Most common information and frequently asked questions
* Features
* Blood Omnicide Codex
* Project: Bloody Sounds
* Project: Distinct Chronicles

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>276</id>
      <timestamp>2012-07-03T08:07:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1549">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
:Most common information and frequently asked questions
* [[Features]]
* [[Blood Omnicide Codex]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>277</id>
      <timestamp>2012-07-03T08:08:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1527">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

===[[Bloody Sounds project]]===
:A sub-project to improve Blood omen soundtrack

===[[Distinct Chronicles project]]===
:A sub-project to improve Blood omen cinematics

===[[Nosgoth]]===
:Information about Nosgoth - world of Blood Omen: Legacy of Kain

===[[Gameplay]]===
:Most common information and frequently asked questions

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>278</id>
      <timestamp>2012-07-03T08:09:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1299">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

===[[Nosgoth]]===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>279</id>
      <timestamp>2012-07-03T08:09:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1297">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== Blood Omnicide project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== Nosgoth ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>280</id>
      <timestamp>2012-07-03T08:09:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1286">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== Nosgoth ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>281</id>
      <timestamp>2012-07-03T08:10:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1317">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Infoportions]]
* [[Call event]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>282</id>
      <timestamp>2012-07-03T08:11:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="1317">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Material system]]
* [[Virtual file system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>283</id>
      <timestamp>2012-07-03T08:11:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine reference */</comment>
      <text xml:space="preserve" bytes="1317">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>284</id>
      <timestamp>2012-07-03T08:12:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing */</comment>
      <text xml:space="preserve" bytes="1350">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;



=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>285</id>
      <timestamp>2012-07-03T08:14:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2134">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Blood Omnicide Wiki&lt;/font&gt;

Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>286</id>
      <timestamp>2012-07-03T08:14:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2116">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>287</id>
      <timestamp>2012-07-03T08:15:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;1&quot;?
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>288</id>
      <timestamp>2012-07-03T08:15:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;1&quot;&gt;
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>289</id>
      <timestamp>2012-07-03T08:15:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;4&quot;&gt;
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>290</id>
      <timestamp>2012-07-03T08:15:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2176">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;3&quot;&gt;
&amp;nbsp;&amp;nbsp;Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

&amp;nbsp;&amp;nbsp;Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

&amp;nbsp;&amp;nbsp;Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>291</id>
      <timestamp>2012-07-03T08:15:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2140">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;7&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;3&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>292</id>
      <timestamp>2012-07-03T08:15:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2140">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

&lt;font size=&quot;5&quot; style=&quot;color:#900;font-weight:bold&quot;&gt;Blood Omnicide Wiki&lt;/font&gt;

&lt;font size=&quot;3&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>293</id>
      <timestamp>2012-07-03T08:16:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2086">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;3&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>294</id>
      <timestamp>2012-07-03T08:16:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2086">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing====
* [[Level editing basics | Basics]]
* [[Entity class reference]]
* [[Terrain blending reference]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>295</id>
      <timestamp>2012-07-03T08:34:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2102">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>298</id>
      <timestamp>2012-07-03T13:02:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Translating Blood Omnicide to other languages */</comment>
      <text xml:space="preserve" bytes="2116">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>367</id>
      <timestamp>2012-07-10T18:29:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2119">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>368</id>
      <timestamp>2012-07-10T18:29:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2136">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>369</id>
      <timestamp>2012-07-10T18:30:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2133">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Call event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>372</id>
      <timestamp>2012-07-10T18:37:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Script reference */</comment>
      <text xml:space="preserve" bytes="2136">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>718</id>
      <timestamp>2012-07-15T02:20:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2148">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Community ===

 | valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>721</id>
      <timestamp>2012-07-16T06:19:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2179">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===

* [[BloodWiki:Community_portal | Community portal]]

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>722</id>
      <timestamp>2012-07-16T06:20:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2195">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===

* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

====Darkplaces engine reference ====
* [[Virtual file system]]
* [[Material system]]

====Modelling====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

====Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

====Script reference====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

====Translating Blood Omnicide to other languages====

* [[Translation | Translation packs reference]]

====Tools &amp; Stuff====

* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>723</id>
      <timestamp>2012-07-16T06:22:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2191">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion reference]]
* [[Translation | Translation packs reference]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>804</id>
      <timestamp>2012-07-16T09:08:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2181">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion reference]]
* [[Translation | Translation packs]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>805</id>
      <timestamp>2012-07-16T09:08:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2178">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is a project to port Blood Omen: Legacy Of Kain to 3D. Main goal is to save original game feel and provide nearly same gameplay and balance. By the way there will be some improvements &amp; innovations, just because of nature of porting. Most critical ones will be optional in order to not violate game experience. Second goal is to provide game SDK that is open for modifications and additions so Omnicide can be used as a base for expansion packs and mods created in the world of Blood Omen.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>806</id>
      <timestamp>2012-07-16T09:09:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1730">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development of Blood Omnicide.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>807</id>
      <timestamp>2012-07-16T11:41:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1755">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development of Blood Omnicide.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>808</id>
      <timestamp>2012-07-16T11:42:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* General reference */</comment>
      <text xml:space="preserve" bytes="1766">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development of Blood Omnicide.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>839</id>
      <timestamp>2012-07-16T16:48:20Z</timestamp>
      <contributor>
        <ip>89.179.235.231</ip>
      </contributor>
      <text xml:space="preserve" bytes="1837">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>848</id>
      <timestamp>2012-07-16T17:11:57Z</timestamp>
      <contributor>
        <username>Amddred</username>
        <id>2</id>
      </contributor>
      <minor/>
      <comment>/* World of Blood Omen */ Adding more options</comment>
      <text xml:space="preserve" bytes="1887">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>883</id>
      <timestamp>2012-07-16T19:29:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1933">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

{{article unfinished}}

==== Level editing reference ====
[[Radiant Glossary]]

* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>884</id>
      <timestamp>2012-07-16T19:29:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1926">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

{{article unfinished}}

==== Level editing reference ====
* [[Glossary]]
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>885</id>
      <timestamp>2012-07-16T19:30:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1945">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

{{article unfinished}}

==== Level editing reference ====
* [[Radiant Glossary | Glossary]]
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>889</id>
      <timestamp>2012-07-16T19:34:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1921">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant Glossary | Glossary]]
* [[Level editing basics | Basics]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>890</id>
      <timestamp>2012-07-16T19:37:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1912">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant Glossary | Glossary]]
* [[Working with brushes]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>891</id>
      <timestamp>2012-07-16T19:39:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1904">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Introduction]]
* [[Radiant/Glossary | Glossary]]
* [[Entity classes]]
* [[Common materials]]
* [[Terrain blending]]
* [[Tutorials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>893</id>
      <timestamp>2012-07-16T19:40:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1886">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction Introduction]]
* [[Radiant/Glossary | Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>894</id>
      <timestamp>2012-07-16T19:40:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1888">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant/Glossary | Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>898</id>
      <timestamp>2012-07-16T19:49:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1896">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant/Glossary | Radiant Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>900</id>
      <timestamp>2012-07-16T19:51:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1896">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant Glossary | Radiant Glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>902</id>
      <timestamp>2012-07-16T19:52:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1896">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant/Introduction | Introduction]]
* [[Radiant Glossary | Radiant glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>903</id>
      <timestamp>2012-07-16T19:52:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1906">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[General reference | Radiant general reference]]
* [[Radiant Glossary | Radiant glossary]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>905</id>
      <timestamp>2012-07-16T19:53:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1864">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MDCompiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>907</id>
      <timestamp>2012-07-16T19:56:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Tools &amp; Stuff */</comment>
      <text xml:space="preserve" bytes="1865">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Entity classes]]
* [[Common materials]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>953</id>
      <timestamp>2012-07-16T20:58:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Level editing reference */</comment>
      <text xml:space="preserve" bytes="1865">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>988</id>
      <timestamp>2012-07-17T05:14:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1909">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Kain armor]]
* [[Kain weapons]]
* [[Kain spells]]
* [[Kain forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1019</id>
      <timestamp>2012-07-17T08:10:57Z</timestamp>
      <contributor>
        <username>Amddred</username>
        <id>2</id>
      </contributor>
      <minor/>
      <comment>/* World of Blood Omen */ Remove Kain</comment>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1221</id>
      <timestamp>2012-07-18T09:57:44Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="1892">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__

1</text>
    </revision>
    <revision>
      <id>1222</id>
      <timestamp>2012-07-18T09:57:51Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1223</id>
      <timestamp>2012-07-18T10:02:34Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1224</id>
      <timestamp>2012-07-18T10:02:40Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1225</id>
      <timestamp>2012-07-18T10:04:30Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1226</id>
      <timestamp>2012-07-18T10:04:36Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1227</id>
      <timestamp>2012-07-18T10:10:26Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1228</id>
      <timestamp>2012-07-18T10:10:31Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1229</id>
      <timestamp>2012-07-18T10:15:02Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1230</id>
      <timestamp>2012-07-18T10:15:10Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1231</id>
      <timestamp>2012-07-18T10:19:20Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1232</id>
      <timestamp>2012-07-18T10:19:32Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1233</id>
      <timestamp>2012-07-18T10:19:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1890">&lt;center&gt;
1
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1234</id>
      <timestamp>2012-07-18T10:19:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1889">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Virtual file system]]
* [[Material system]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1320</id>
      <timestamp>2012-07-20T10:50:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2003">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces Material system | Material system]]
* [[Material system | Old Material system article]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1324</id>
      <timestamp>2012-07-20T10:52:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2003">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Material system | Old Material system article]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1325</id>
      <timestamp>2012-07-20T10:52:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="1997">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Material system | Material system (old)]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1328</id>
      <timestamp>2012-07-20T10:59:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2058">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Material system | Material system (old)]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1706</id>
      <timestamp>2012-07-23T10:12:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="2012">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Modelling ====
* [[Modelling basics | Basics]]
* [[Export / Import plugins]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1780</id>
      <timestamp>2012-07-26T05:55:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1929">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

Blood Omnicide is modification, it provides a patch that will port original game to new rendering pipeline. Blood Omnicide would require original PC Blood Omen or Playstation version of Blood Omen in order to play.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1781</id>
      <timestamp>2012-07-26T10:36:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1713">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1925</id>
      <timestamp>2012-07-27T09:58:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1713">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1958</id>
      <timestamp>2012-07-27T11:11:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1750">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces lighting | Lighting]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1961</id>
      <timestamp>2012-07-27T12:21:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development Topics */</comment>
      <text xml:space="preserve" bytes="1796">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces lighting | Lighting]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1962</id>
      <timestamp>2012-07-27T12:22:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Darkplaces engine */</comment>
      <text xml:space="preserve" bytes="1796">&lt;center&gt;

{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
 | valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50% |

= Blood Omnicide Wiki =

&lt;font size=&quot;2&quot;&gt;
Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.

This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

=== Wiki ===
* [[BloodWiki:Community_portal | Community portal]]

=== The project ===
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]

=== World of Blood Omen ===
* [[World of Blood Omen-era]]
* [[Armor]]
* [[Weapons]]
* [[Spells]]
* [[Forms]]
* [[Artifacts]]
* [[Enemies]]

| valign=top |

== Development Topics ==

==== General reference ====
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]

==== Darkplaces engine ====
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]

==== Level editing reference ====
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

==== Script reference ====
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]

==== Tools &amp; Stuff ====
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]

 |}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1983</id>
      <timestamp>2012-07-27T13:14:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1924">{{DISPLAYTITLE:Blood Omnicide Wiki}}
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1984</id>
      <timestamp>2012-07-27T13:16:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1911">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;

__NOTOC__</text>
    </revision>
    <revision>
      <id>1987</id>
      <timestamp>2012-07-27T13:19:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1910">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2191</id>
      <timestamp>2012-07-29T22:42:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1955">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:Recent_pages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__</text>
    </revision>
    <revision>
      <id>2202</id>
      <timestamp>2012-07-30T05:40:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1968">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:Recent_pages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2231</id>
      <timestamp>2012-07-30T19:48:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1967">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2342</id>
      <timestamp>2012-08-01T09:24:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="1968">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[SourceScanner]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2355</id>
      <timestamp>2012-08-01T10:05:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1948">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide Goals | Goals]]
* [[Blood Omnicide Features | Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2359</id>
      <timestamp>2012-08-01T10:52:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1966">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Subversion basics]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2365</id>
      <timestamp>2012-08-01T12:48:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1969">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces features | Features overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2405</id>
      <timestamp>2012-08-03T06:48:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1964">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2528</id>
      <timestamp>2012-08-09T12:54:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1989">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2544</id>
      <timestamp>2012-08-09T14:23:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2012">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant general reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2691</id>
      <timestamp>2012-09-25T21:10:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2012">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Script reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2794</id>
      <timestamp>2012-10-16T15:12:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2020">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[Notepad++ syntax hightlight]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2806</id>
      <timestamp>2012-11-21T20:23:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2024">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[BloodPill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2814</id>
      <timestamp>2012-11-22T05:04:15Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="2025">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2845</id>
      <timestamp>2012-11-22T11:01:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2055">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Zone event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2850</id>
      <timestamp>2012-11-22T11:34:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2038">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]

&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Project: Bloody Sounds]]
* [[Project: Distinct Chronicles]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2868</id>
      <timestamp>2012-11-22T12:41:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2146">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in russian]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2869</id>
      <timestamp>2012-11-22T12:42:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2146">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide.
This Wiki is dedicated to development process of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;The project&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[World of Blood Omen-era]]
* [[Blood Omen file formats]]
* [[Kain's inventory and abilities]]
* [[Enemies]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | Repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}

&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2911</id>
      <timestamp>2012-11-23T03:15:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2087">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=10 style=&quot;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|rowspan=2 valign=top style=&quot;border-right: 1px solid #DDD&quot; width=50%|&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.
&lt;/font&gt;

&lt;h3&gt;Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
* [[ChangeLog:Blood Omnicide|SVN change log]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[Game world reference]]
* [[Blood Omen file formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]

|colspan=3 style=&quot;padding-bottom: 0px&quot;|&lt;h2&gt;Development Topics&lt;/h2&gt;
|-
|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;General reference&lt;/h4&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]

|valign=top style=&quot;padding-top: 0px&quot;|&lt;h4&gt;Game scripting reference&lt;/h4&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|valign=top style=&quot;padding-top: 0px&quot;|&amp;nbsp;
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2931</id>
      <timestamp>2012-11-28T17:18:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2261">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen: Legacy of Kain&lt;/h3&gt;
* [[Game world reference]]
* [[Blood Omen file formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2932</id>
      <timestamp>2012-11-28T17:19:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2245">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Game world reference]]
* [[Blood Omen file formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2946</id>
      <timestamp>2012-11-29T20:51:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2306">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[Blood Omen/Characters|Characters]]
* [[Blood Omen/File formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3120</id>
      <timestamp>2012-11-30T10:12:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2316">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen File formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3122</id>
      <timestamp>2012-11-30T10:12:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2316">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3274</id>
      <timestamp>2012-11-30T11:16:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2358">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3286</id>
      <timestamp>2012-12-01T23:57:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2374">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;padding-top:0px&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3287</id>
      <timestamp>2012-12-01T23:57:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2377">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:BloodySounds | Bloody Sounds]]
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3289</id>
      <timestamp>2012-12-02T02:10:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2335">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;querysort=date&amp;date=explicit&amp;mindate=2000-01-00&amp;maxdate=2020-01-00&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3291</id>
      <timestamp>2012-12-03T21:52:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2358">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3348</id>
      <timestamp>2013-01-15T13:29:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2405">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3433</id>
      <timestamp>2013-01-22T16:40:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2235">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
Currently SVN changelog is not available
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3472</id>
      <timestamp>2013-01-22T19:15:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2249">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
Currently SVN changelog is not available
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}
{{Languages}}</text>
    </revision>
    <revision>
      <id>3473</id>
      <timestamp>2013-01-22T19:15:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2235">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
Currently SVN changelog is not available
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3579</id>
      <timestamp>2013-01-31T19:45:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2405">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3612</id>
      <timestamp>2013-02-24T08:22:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>fixed SVN log to show up again</comment>
      <text xml:space="preserve" bytes="2453">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3634</id>
      <timestamp>2013-04-09T18:05:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2609">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
'''Sorry. Currently we experiencing problems with SVN RSS feed.'''

'''You can find the actual SVN log [http://www.svn2rss.ru/svn.show.php?id=25 here]'''


&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3645</id>
      <timestamp>2013-04-18T15:49:38Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2613">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
'''Sorry. Currently we are experiencing problems with SVN RSS feed.'''

'''You can find the actual SVN log [http://www.svn2rss.ru/svn.show.php?id=25 here]'''


&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3647</id>
      <timestamp>2013-06-05T20:03:24Z</timestamp>
      <contributor>
        <ip>176.15.29.31</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2453">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3661</id>
      <timestamp>2013-09-01T11:19:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2293">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3671</id>
      <timestamp>2013-10-02T06:03:08Z</timestamp>
      <contributor>
        <ip>185.10.129.248</ip>
      </contributor>
      <comment>/* Blood Omnicide Wiki */</comment>
      <text xml:space="preserve" bytes="2339">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[DpEditor Reference | DpEditor Reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3677</id>
      <timestamp>2013-10-02T11:37:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2343">= Blood Omnicide Wiki =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Welcome to the Blood Wiki, an official development wiki of Blood Omnicide. Here you can find info about modifying any aspect of the game.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;The Wiki&lt;/h3&gt;
* [[BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Recent pages]]
&lt;h3&gt;Blood Omnicide General&lt;/h3&gt;
* [[Blood Omnicide goals and features | Goals &amp; Features]]
* [[Blood Omnicide complete feature list | Complete feature list]]
* [[:Category:Concept art | Concept art]]
* [[Blood Omnicide team|The Team]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|The World]]
* [[:Category:Blood Omen characters|Characters]]
* [[Blood Omen file formats|File formats]]
&lt;h3&gt;Portals&lt;/h3&gt;
* [[Portal:InRussian | Blood Wiki in Russian]]
* [[Portal:InItalian | Blood Wiki in Italian]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Development Topics&lt;/h3&gt;
* [[Repository Reference | SVN repository reference]]
* [[OmniEditor reference | OmniEditor reference]]
* [[Translation | Translation packs]]
* [[:Category:File formats | File formats]]
* [[:Category:Glossary | Glossary]]
&lt;h4&gt;Darkplaces engine&lt;/h4&gt;
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt;
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt;
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tools &amp; Stuff&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|3ds Max tools]]
|}
&lt;/center&gt;
__NOTOC__
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Manslug</title>
    <ns>0</ns>
    <id>590</id>
      <sha1>kwmppsgeck1hy2r7a2ki4c66ftw85fg</sha1>
    <revision>
      <id>3342</id>
      <timestamp>2012-12-27T21:20:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden|bo_enemy_manslug.gif|Sawtooth}} A half-human Dark Eden mutant. Big and clymsy, but very dangerous enemy because of its poisoning attack.   ==Stats== :Health: 40...&quot;</comment>
      <text xml:space="preserve" bytes="372">{{BoEnemy|eden|bo_enemy_manslug.gif|Sawtooth}}
A half-human Dark Eden mutant. Big and clymsy, but very dangerous enemy because of its poisoning attack. 

==Stats==
:Health: 40
:Damage: 15 (poison)
:Blood: green
:Walk speed: medium
:Character type: animal
:Entity: [[animal_manslug]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred manslug.png
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3343</id>
      <timestamp>2012-12-27T21:20:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="371">{{BoEnemy|eden|bo_enemy_manslug.gif|Manslug}}
A half-human Dark Eden mutant. Big and clymsy, but very dangerous enemy because of its poisoning attack. 

==Stats==
:Health: 40
:Damage: 15 (poison)
:Blood: green
:Walk speed: medium
:Character type: animal
:Entity: [[animal_manslug]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred manslug.png
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:About</title>
    <ns>8</ns>
    <id>163</id>
      <sha1>6za6z27cqk2qatlebqsiz85czbjf3rd</sha1>
    <revision>
      <id>1989</id>
      <timestamp>2012-07-27T13:20:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;-&quot;</comment>
      <text xml:space="preserve" bytes="1">-</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:Common.css</title>
    <ns>8</ns>
    <id>62</id>
      <sha1>ixw6plvpp8ya9x6zz6in6hnt0x13ki0</sha1>
    <revision>
      <id>530</id>
      <timestamp>2012-07-14T23:17:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;/* Content Showing/Hiding */ div.NavFrame {     margin: 0;     padding: 4px;     border: 1px solid #aaa;     text-align: center;     border-collapse: collapse;     font-size: ...&quot;</comment>
      <text xml:space="preserve" bytes="821">/* Content Showing/Hiding */
div.NavFrame {
    margin: 0;
    padding: 4px;
    border: 1px solid #aaa;
    text-align: center;
    border-collapse: collapse;
    font-size: 95%;
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    position: absolute;
    top: 0;
    /* @noflip */
    right: 3px;
    font-weight: normal;
    font-size: 90%;
}</text>
    </revision>
    <revision>
      <id>560</id>
      <timestamp>2012-07-14T23:46:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="838">/* Content Showing/Hiding */
div.NavFrame {
    width: auto;
    margin: 0;
    padding: 4px;
    border: 1px solid #aaa;
    text-align: center;
    border-collapse: collapse;
    font-size: 95%;
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    position: absolute;
    top: 0;
    /* @noflip */
    right: 3px;
    font-weight: normal;
    font-size: 90%;
}</text>
    </revision>
    <revision>
      <id>562</id>
      <timestamp>2012-07-14T23:49:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="841">/* Content Showing/Hiding */
div.NavFrame {
    margin: 0;
    padding: 4px;
    border: 1px solid #aaa;
    text-align: center;
    border-collapse: collapse;
    font-size: 95%;
    display: block;
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    position: absolute;
    top: 0;
    /* @noflip */
    right: 3px;
    font-weight: normal;
    font-size: 90%;
}</text>
    </revision>
    <revision>
      <id>563</id>
      <timestamp>2012-07-14T23:49:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="819">/* Content Showing/Hiding */
div.NavFrame {
    margin: 0;
    padding: 4px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
    font-size: 95%;
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    position: absolute;
    top: 0;
    /* @noflip */
    right: 3px;
    font-weight: normal;
    font-size: 90%;
}</text>
    </revision>
    <revision>
      <id>564</id>
      <timestamp>2012-07-14T23:50:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="783">/* Content Showing/Hiding */
div.NavFrame {
    margin: 0;
    padding: 4px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
    font-size: 95%;
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    /* @noflip */
    right: 3px;
    font-weight: normal;
    font-size: 90%;
}</text>
    </revision>
    <revision>
      <id>565</id>
      <timestamp>2012-07-14T23:51:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="729">/* Content Showing/Hiding */
div.NavFrame {
    margin: 0;
    padding: 4px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
    font-size: 95%;
}
div.NavFrame + div.NavFrame {
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic {
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead {
    height: 1.6em;
    font-weight: bold;
    background-color: #ccf;
    position: relative;
}
div.NavFrame p,
div.NavFrame div.NavContent,
div.NavFrame div.NavContent p {
    font-size: 100%;
}
div.NavEnd {
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle {
    font-weight: normal;
}</text>
    </revision>
    <revision>
      <id>567</id>
      <timestamp>2012-07-14T23:52:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="627">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.8em;
    font-weight: bold;
    background-color: #ffc;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}</text>
    </revision>
    <revision>
      <id>568</id>
      <timestamp>2012-07-14T23:53:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="627">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.8em;
    font-weight: bold;
    background-color: #ffe;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}</text>
    </revision>
    <revision>
      <id>569</id>
      <timestamp>2012-07-14T23:56:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="630">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.8em;
    font-weight: bold;
    background-color: #EEDFDF;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}</text>
    </revision>
    <revision>
      <id>571</id>
      <timestamp>2012-07-14T23:57:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="599">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}</text>
    </revision>
    <revision>
      <id>1104</id>
      <timestamp>2012-07-17T23:00:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="668">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
mw-content-text th
{
    background-color: #EEE;
}</text>
    </revision>
    <revision>
      <id>1105</id>
      <timestamp>2012-07-17T23:02:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="652">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
th
{
    background-color: #EEE;
}</text>
    </revision>
    <revision>
      <id>1121</id>
      <timestamp>2012-07-17T23:21:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="696">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
th, .shadow
{
    background-color: #EEE;
}
.shadow
{
    font-weight: bold;
}</text>
    </revision>
    <revision>
      <id>1122</id>
      <timestamp>2012-07-17T23:21:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="661">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
th, .shadow
{
    background-color: #EEE;
}</text>
    </revision>
    <revision>
      <id>1159</id>
      <timestamp>2012-07-17T23:53:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="693">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
table
{
 margin-bottom: 10px;
}
th, .shadow
{
    background-color: #EEE;
}</text>
    </revision>
    <revision>
      <id>2936</id>
      <timestamp>2012-11-28T19:09:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="866">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
table
{
 margin-bottom: 10px;
}
th, .shadow
{
    background-color: #EEE;
}
/* blood omen enemies */
div.bo_bg_out { background-image: url(images/static/bo_bg_ave.gif); }
div.bo_bg_bastion { background-image: url(images/static/bo_bg_bastion.gif); }</text>
    </revision>
    <revision>
      <id>2937</id>
      <timestamp>2012-11-28T19:10:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="860">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
table
{
 margin-bottom: 10px;
}
th, .shadow
{
    background-color: #EEE;
}
/* blood omen enemies */
.bo_bg_out { background-image: url(images/static/bo_bg_ave.gif); }
.bo_bg_bastion { background-image: url(images/static/bo_bg_bastion.gif); }</text>
    </revision>
    <revision>
      <id>2938</id>
      <timestamp>2012-11-28T19:25:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2424">/* Content Showing/Hiding */
div.NavFrame
{
    margin: 0;
    padding: 6px;
    border: 1px solid #aaa;
    text-align: left;
    border-collapse: collapse;
}
div.NavFrame + div.NavFrame
{
    border-top-style: none;
    border-top-style: hidden;
}
div.NavPic
{
    background-color: #fff;
    margin: 0;
    padding: 2px;
    /* @noflip */
    float: left;
}
div.NavFrame div.NavHead
{
    height: 1.6em;
    font-weight: bold;
    position: relative;
}
div.NavEnd
{
    margin: 0;
    padding: 0;
    line-height: 1px;
    clear: both;
}
a.NavToggle
{
    font-weight: normal;
    /* @noflip */
}

/* Table head */
table
{
 margin-bottom: 10px;
}
th, .shadow
{
    background-color: #EEE;
}
/* blood omen enemies */
.bo_bg_ave { background-image: url(images/static/bo_bg_ave.gif); }
.bo_bg_bastion { background-image: url(images/static/bo_bg_bastion.gif); }
.bo_bg_cave { background-image: url(images/static/bo_bg_cave.gif); }
.bo_bg_cave2 { background-image: url(images/static/bo_bg_cave2.gif); }
.bo_bg_choppin { background-image: url(images/static/bo_bg_choppin.gif); }
.bo_bg_collector { background-image: url(images/static/bo_bg_collector.gif); }
.bo_bg_crypt1 { background-image: url(images/static/bo_bg_crypt1.gif); }
.bo_bg_crypt2 { background-image: url(images/static/bo_bg_crypt2.gif); }
.bo_bg_crypt3 { background-image: url(images/static/bo_bg_crypt3.gif); }
.bo_bg_dung { background-image: url(images/static/bo_bg_dung.gif); }
.bo_bg_dung2 { background-image: url(images/static/bo_bg_dung2.gif); }
.bo_bg_dung3 { background-image: url(images/static/bo_bg_dung3.gif); }
.bo_bg_eden { background-image: url(images/static/bo_bg_eden.gif); }
.bo_bg_eden2 { background-image: url(images/static/bo_bg_eden2.gif); }
.bo_bg_grv { background-image: url(images/static/bo_bg_grv.gif); }
.bo_bg_house1 { background-image: url(images/static/bo_bg_house1.gif); }
.bo_bg_house2 { background-image: url(images/static/bo_bg_house2.gif); }
.bo_bg_inn { background-image: url(images/static/bo_bg_inn.gif); }
.bo_bg_out { background-image: url(images/static/bo_bg_out.gif); }
.bo_bg_out2 { background-image: url(images/static/bo_bg_out2.gif); }
.bo_bg_smith { background-image: url(images/static/bo_bg_smith.gif); }
.bo_bg_tower { background-image: url(images/static/bo_bg_tower.gif); }
.bo_bg_wall { background-image: url(images/static/bo_bg_wall.gif); }
.bo_bg_willen { background-image: url(images/static/bo_bg_willen.gif); }</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:Common.js</title>
    <ns>8</ns>
    <id>63</id>
      <sha1>0hlmvc1lmbhygd87aw189xjlhmkyczr</sha1>
    <revision>
      <id>531</id>
      <timestamp>2012-07-14T23:18:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;/** Dynamic Navigation Bars (experimental) *************************************  *  *  Description: See [[Wikipedia:NavFrame]].  *  Maintainers: UNMAINTAINED  */  // set up t...&quot;</comment>
      <text xml:space="preserve" bytes="4807">/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}</text>
    </revision>
    <revision>
      <id>532</id>
      <timestamp>2012-07-14T23:20:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4978">mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>533</id>
      <timestamp>2012-07-14T23:21:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18328">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/**
 * Redirect User:Name/skin.js and skin.css to the current skin's pages
 * (unless the 'skin' page really exists)
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js
 * @rev: 2
 */
if ( mw.config.get( 'wgArticleId' ) === 0 &amp;&amp; mw.config.get( 'wgNamespaceNumber' ) == 2 ) {
	var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
	// Make sure there was a part before and after the slash
	// And that the latter is 'skin.js' or 'skin.css'
	if ( titleParts.length == 2 ) {
		var userSkinPage = titleParts.shift() + '/' + mw.config.get( 'skin' );
		if ( titleParts.slice(-1) == 'skin.js' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.js' );
		} else if ( titleParts.slice(-1) == 'skin.css' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.css' );
		}
	}
}

/** Map addPortletLink to mw.util 
 */
window.addPortletLink = function() {
    return mw.util.addPortletLink.apply( mw.util, arguments );
};

/** extract a URL parameter from the current URL **********
 *
 * @deprecated: Use mw.util.getParamValue with proper escaping
 */
window.getURLParamValue = function() {
    return mw.util.getParamValue.apply( mw.util, arguments );
};

/** &amp;withCSS= and &amp;withJS= URL parameters *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing personal .css or .js files
 */
var extraCSS = mw.util.getParamValue(&quot;withCSS&quot;);
if ( extraCSS &amp;&amp; extraCSS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.css$/) ) {
    importStylesheet(extraCSS);
}
var extraJS = mw.util.getParamValue(&quot;withJS&quot;);
if ( extraJS &amp;&amp; extraJS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$/) ) {
    importScript(extraJS);
}


/* Import more specific scripts if necessary */
if (wgAction == 'edit' || wgAction == 'submit' || wgPageName == 'Special:Upload') { //scripts specific to editing pages
    importScript('MediaWiki:Common.js/edit.js');
}
else if (mw.config.get('wgPageName') == 'Special:Watchlist') { //watchlist scripts
    mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=MediaWiki:Common.js/watchlist.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');
}

if ( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/**
 * WikiMiniAtlas
 *
 *  Description: WikiMiniAtlas is a popup click and drag world map.
 *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 *               The script itself is located on meta because it is used by many projects.
 *               See [[Meta:WikiMiniAtlas]] for more information. 
 *  Maintainers: [[User:Dschwen]]
 */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');

/* Scripts specific to Internet Explorer */
if ($.client.profile().name == 'msie') {
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    var fixIEScroll = function() {
        if (!oldWidth || docEl.clientWidth &gt; oldWidth) {
            doFixIEScroll();
        } else {
            setTimeout(doFixIEScroll, 1);
        }
        
        oldWidth = docEl.clientWidth;
    };
    
    var doFixIEScroll = function () {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4) ? &quot;hidden&quot; : &quot;&quot;;
    };
    
    document.attachEvent(&quot;onreadystatechange&quot;, fixIEScroll);
    document.attachEvent(&quot;onresize&quot;, fixIEScroll);
    
    // In print IE (7?) does not like line-height
    mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');

    // IE overflow bug
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
      + 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    // Use to fix right floating div/table inside tables
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');

    // Import scripts specific to Internet Explorer 6
    if ($.client.profile().versionBase == '6') {
        importScript('MediaWiki:Common.js/IE60Fixes.js');
    }
}

/* Fixes for Windows font rendering */
if ($.client.profile().platform == 'win') {
    mw.util.addCSS('.IPA, .Unicode { font-family: &quot;Arial Unicode MS&quot;, &quot;Lucida Sans Unicode&quot;; }');
}

/* Helper script for .hlist class in common.css
 * Maintainer: [[User:Edokter]]
 */
 
if ( $.client.profile().name == 'msie' ) {
  /* Add pseudo-selector class to last child list items in IE 8 */
  if ( $.client.profile().versionBase == '8' ) {
    $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
      .addClass( 'hlist-last-child' );
  }
  /* Generate interpuncts and parens for IE &lt; 8 */
  if ( $.client.profile().versionBase &lt; '8' ) {
    $( '.hlist' ).find( 'dt + dd, dt + dt' ).prev()
      .append( '&lt;b&gt;:&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dd + dd, dd + dt, li + li' ).prev()
      .append( '&lt;b&gt;·&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dl dl, ol ol, ul ul' )
      .prepend( '( ' ).append( ') ' );
  }
}

/* Test if an element has a certain class
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 *
 * @deprecated:  Use $(element).hasClass() instead.
 */

window.hasClass = ( function() {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() {
    if ( document.getElementById( &quot;p-lang&quot; ) ) {
        var InterwikiLinks = document.getElementById( &quot;p-lang&quot; ).getElementsByTagName( &quot;li&quot; );

        for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + &quot;-fa&quot; ) ) {
                InterwikiLinks[i].className += &quot; FA&quot;;
                InterwikiLinks[i].title = &quot;This is a featured article in another language.&quot;;
            } else if ( document.getElementById( InterwikiLinks[i].className + &quot;-ga&quot; ) ) {
                InterwikiLinks[i].className += &quot; GA&quot;;
                InterwikiLinks[i].title = &quot;This is a good article in another language.&quot;;
            }
        }
    }
}

$( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */
ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 */
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == &quot;Upload&quot; &amp;&amp; wgAction == &quot;view&quot;) {
    var oldDiv = document.getElementById(&quot;autoconfirmedusers&quot;),
        newDiv = document.getElementById(&quot;newusers&quot;);
    if (oldDiv &amp;&amp; newDiv) {
      if (typeof wgUserGroups == &quot;object&quot; &amp;&amp; wgUserGroups) {
        for (i = 0; i &lt; wgUserGroups.length; i++) {
          if (wgUserGroups[i] == &quot;autoconfirmed&quot;) {
            oldDiv.style.display = &quot;block&quot;;
            newDiv.style.display = &quot;none&quot;;
            return;
          }
        }
      }
      oldDiv.style.display = &quot;none&quot;;
      newDiv.style.display = &quot;block&quot;;
      return;
    }
  }
}
$(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing 

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != &quot;https://secure.wikimedia.org&quot;) &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript(&quot;MediaWiki:Common.js/IPv6.js&quot;);
}
**/

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro( name ) {
  $( '.editsection, #ca-edit' ).find( 'a' ).each( function( i, el ) {
    el.href = $(this).attr(&quot;href&quot;) + '&amp;editintro=' + name;
  });
}

if (wgNamespaceNumber === 0) {
  $(function(){
    if (document.getElementById('disambigbox')) {
      addEditIntro('Template:Disambig_editintro');
    }
  });

  $(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats) {
      return;
    }
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i &lt; cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/**
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if ( mw.config.get('wgServer') == 'https://secure.wikimedia.org' ) {
    /* Old secure server */
    importScript( 'MediaWiki:Common.js/secure.js');
} else if( document.location &amp;&amp; document.location.protocol  &amp;&amp; document.location.protocol == &quot;https:&quot; ) {
  /* New secure servers */
  importScript('MediaWiki:Common.js/secure new.js');
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>544</id>
      <timestamp>2012-07-14T23:32:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="8410">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>545</id>
      <timestamp>2012-07-14T23:33:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18328">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/**
 * Redirect User:Name/skin.js and skin.css to the current skin's pages
 * (unless the 'skin' page really exists)
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js
 * @rev: 2
 */
if ( mw.config.get( 'wgArticleId' ) === 0 &amp;&amp; mw.config.get( 'wgNamespaceNumber' ) == 2 ) {
	var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
	// Make sure there was a part before and after the slash
	// And that the latter is 'skin.js' or 'skin.css'
	if ( titleParts.length == 2 ) {
		var userSkinPage = titleParts.shift() + '/' + mw.config.get( 'skin' );
		if ( titleParts.slice(-1) == 'skin.js' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.js' );
		} else if ( titleParts.slice(-1) == 'skin.css' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.css' );
		}
	}
}

/** Map addPortletLink to mw.util 
 */
window.addPortletLink = function() {
    return mw.util.addPortletLink.apply( mw.util, arguments );
};

/** extract a URL parameter from the current URL **********
 *
 * @deprecated: Use mw.util.getParamValue with proper escaping
 */
window.getURLParamValue = function() {
    return mw.util.getParamValue.apply( mw.util, arguments );
};

/** &amp;withCSS= and &amp;withJS= URL parameters *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing personal .css or .js files
 */
var extraCSS = mw.util.getParamValue(&quot;withCSS&quot;);
if ( extraCSS &amp;&amp; extraCSS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.css$/) ) {
    importStylesheet(extraCSS);
}
var extraJS = mw.util.getParamValue(&quot;withJS&quot;);
if ( extraJS &amp;&amp; extraJS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$/) ) {
    importScript(extraJS);
}


/* Import more specific scripts if necessary */
if (wgAction == 'edit' || wgAction == 'submit' || wgPageName == 'Special:Upload') { //scripts specific to editing pages
    importScript('MediaWiki:Common.js/edit.js');
}
else if (mw.config.get('wgPageName') == 'Special:Watchlist') { //watchlist scripts
    mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=MediaWiki:Common.js/watchlist.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');
}

if ( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/**
 * WikiMiniAtlas
 *
 *  Description: WikiMiniAtlas is a popup click and drag world map.
 *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 *               The script itself is located on meta because it is used by many projects.
 *               See [[Meta:WikiMiniAtlas]] for more information. 
 *  Maintainers: [[User:Dschwen]]
 */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');

/* Scripts specific to Internet Explorer */
if ($.client.profile().name == 'msie') {
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    var fixIEScroll = function() {
        if (!oldWidth || docEl.clientWidth &gt; oldWidth) {
            doFixIEScroll();
        } else {
            setTimeout(doFixIEScroll, 1);
        }
        
        oldWidth = docEl.clientWidth;
    };
    
    var doFixIEScroll = function () {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4) ? &quot;hidden&quot; : &quot;&quot;;
    };
    
    document.attachEvent(&quot;onreadystatechange&quot;, fixIEScroll);
    document.attachEvent(&quot;onresize&quot;, fixIEScroll);
    
    // In print IE (7?) does not like line-height
    mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');

    // IE overflow bug
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
      + 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    // Use to fix right floating div/table inside tables
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');

    // Import scripts specific to Internet Explorer 6
    if ($.client.profile().versionBase == '6') {
        importScript('MediaWiki:Common.js/IE60Fixes.js');
    }
}

/* Fixes for Windows font rendering */
if ($.client.profile().platform == 'win') {
    mw.util.addCSS('.IPA, .Unicode { font-family: &quot;Arial Unicode MS&quot;, &quot;Lucida Sans Unicode&quot;; }');
}

/* Helper script for .hlist class in common.css
 * Maintainer: [[User:Edokter]]
 */
 
if ( $.client.profile().name == 'msie' ) {
  /* Add pseudo-selector class to last child list items in IE 8 */
  if ( $.client.profile().versionBase == '8' ) {
    $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
      .addClass( 'hlist-last-child' );
  }
  /* Generate interpuncts and parens for IE &lt; 8 */
  if ( $.client.profile().versionBase &lt; '8' ) {
    $( '.hlist' ).find( 'dt + dd, dt + dt' ).prev()
      .append( '&lt;b&gt;:&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dd + dd, dd + dt, li + li' ).prev()
      .append( '&lt;b&gt;·&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dl dl, ol ol, ul ul' )
      .prepend( '( ' ).append( ') ' );
  }
}

/* Test if an element has a certain class
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 *
 * @deprecated:  Use $(element).hasClass() instead.
 */

window.hasClass = ( function() {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() {
    if ( document.getElementById( &quot;p-lang&quot; ) ) {
        var InterwikiLinks = document.getElementById( &quot;p-lang&quot; ).getElementsByTagName( &quot;li&quot; );

        for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + &quot;-fa&quot; ) ) {
                InterwikiLinks[i].className += &quot; FA&quot;;
                InterwikiLinks[i].title = &quot;This is a featured article in another language.&quot;;
            } else if ( document.getElementById( InterwikiLinks[i].className + &quot;-ga&quot; ) ) {
                InterwikiLinks[i].className += &quot; GA&quot;;
                InterwikiLinks[i].title = &quot;This is a good article in another language.&quot;;
            }
        }
    }
}

$( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */
ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 */
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == &quot;Upload&quot; &amp;&amp; wgAction == &quot;view&quot;) {
    var oldDiv = document.getElementById(&quot;autoconfirmedusers&quot;),
        newDiv = document.getElementById(&quot;newusers&quot;);
    if (oldDiv &amp;&amp; newDiv) {
      if (typeof wgUserGroups == &quot;object&quot; &amp;&amp; wgUserGroups) {
        for (i = 0; i &lt; wgUserGroups.length; i++) {
          if (wgUserGroups[i] == &quot;autoconfirmed&quot;) {
            oldDiv.style.display = &quot;block&quot;;
            newDiv.style.display = &quot;none&quot;;
            return;
          }
        }
      }
      oldDiv.style.display = &quot;none&quot;;
      newDiv.style.display = &quot;block&quot;;
      return;
    }
  }
}
$(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing 

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != &quot;https://secure.wikimedia.org&quot;) &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript(&quot;MediaWiki:Common.js/IPv6.js&quot;);
}
**/

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro( name ) {
  $( '.editsection, #ca-edit' ).find( 'a' ).each( function( i, el ) {
    el.href = $(this).attr(&quot;href&quot;) + '&amp;editintro=' + name;
  });
}

if (wgNamespaceNumber === 0) {
  $(function(){
    if (document.getElementById('disambigbox')) {
      addEditIntro('Template:Disambig_editintro');
    }
  });

  $(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats) {
      return;
    }
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i &lt; cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/**
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if ( mw.config.get('wgServer') == 'https://secure.wikimedia.org' ) {
    /* Old secure server */
    importScript( 'MediaWiki:Common.js/secure.js');
} else if( document.location &amp;&amp; document.location.protocol  &amp;&amp; document.location.protocol == &quot;https:&quot; ) {
  /* New secure servers */
  importScript('MediaWiki:Common.js/secure new.js');
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>572</id>
      <timestamp>2012-07-14T23:59:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18342">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/**
 * Redirect User:Name/skin.js and skin.css to the current skin's pages
 * (unless the 'skin' page really exists)
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js
 * @rev: 2
 */
if ( mw.config.get( 'wgArticleId' ) === 0 &amp;&amp; mw.config.get( 'wgNamespaceNumber' ) == 2 ) {
	var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
	// Make sure there was a part before and after the slash
	// And that the latter is 'skin.js' or 'skin.css'
	if ( titleParts.length == 2 ) {
		var userSkinPage = titleParts.shift() + '/' + mw.config.get( 'skin' );
		if ( titleParts.slice(-1) == 'skin.js' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.js' );
		} else if ( titleParts.slice(-1) == 'skin.css' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.css' );
		}
	}
}

/** Map addPortletLink to mw.util 
 */
window.addPortletLink = function() {
    return mw.util.addPortletLink.apply( mw.util, arguments );
};

/** extract a URL parameter from the current URL **********
 *
 * @deprecated: Use mw.util.getParamValue with proper escaping
 */
window.getURLParamValue = function() {
    return mw.util.getParamValue.apply( mw.util, arguments );
};

/** &amp;withCSS= and &amp;withJS= URL parameters *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing personal .css or .js files
 */
var extraCSS = mw.util.getParamValue(&quot;withCSS&quot;);
if ( extraCSS &amp;&amp; extraCSS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.css$/) ) {
    importStylesheet(extraCSS);
}
var extraJS = mw.util.getParamValue(&quot;withJS&quot;);
if ( extraJS &amp;&amp; extraJS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$/) ) {
    importScript(extraJS);
}


/* Import more specific scripts if necessary */
if (wgAction == 'edit' || wgAction == 'submit' || wgPageName == 'Special:Upload') { //scripts specific to editing pages
    importScript('MediaWiki:Common.js/edit.js');
}
else if (mw.config.get('wgPageName') == 'Special:Watchlist') { //watchlist scripts
    mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=MediaWiki:Common.js/watchlist.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');
}

if ( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/**
 * WikiMiniAtlas
 *
 *  Description: WikiMiniAtlas is a popup click and drag world map.
 *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 *               The script itself is located on meta because it is used by many projects.
 *               See [[Meta:WikiMiniAtlas]] for more information. 
 *  Maintainers: [[User:Dschwen]]
 */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');

/* Scripts specific to Internet Explorer */
if ($.client.profile().name == 'msie') {
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    var fixIEScroll = function() {
        if (!oldWidth || docEl.clientWidth &gt; oldWidth) {
            doFixIEScroll();
        } else {
            setTimeout(doFixIEScroll, 1);
        }
        
        oldWidth = docEl.clientWidth;
    };
    
    var doFixIEScroll = function () {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4) ? &quot;hidden&quot; : &quot;&quot;;
    };
    
    document.attachEvent(&quot;onreadystatechange&quot;, fixIEScroll);
    document.attachEvent(&quot;onresize&quot;, fixIEScroll);
    
    // In print IE (7?) does not like line-height
    mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');

    // IE overflow bug
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
      + 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    // Use to fix right floating div/table inside tables
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');

    // Import scripts specific to Internet Explorer 6
    if ($.client.profile().versionBase == '6') {
        importScript('MediaWiki:Common.js/IE60Fixes.js');
    }
}

/* Fixes for Windows font rendering */
if ($.client.profile().platform == 'win') {
    mw.util.addCSS('.IPA, .Unicode { font-family: &quot;Arial Unicode MS&quot;, &quot;Lucida Sans Unicode&quot;; }');
}

/* Helper script for .hlist class in common.css
 * Maintainer: [[User:Edokter]]
 */
 
if ( $.client.profile().name == 'msie' ) {
  /* Add pseudo-selector class to last child list items in IE 8 */
  if ( $.client.profile().versionBase == '8' ) {
    $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
      .addClass( 'hlist-last-child' );
  }
  /* Generate interpuncts and parens for IE &lt; 8 */
  if ( $.client.profile().versionBase &lt; '8' ) {
    $( '.hlist' ).find( 'dt + dd, dt + dt' ).prev()
      .append( '&lt;b&gt;:&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dd + dd, dd + dt, li + li' ).prev()
      .append( '&lt;b&gt;·&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dl dl, ol ol, ul ul' )
      .prepend( '( ' ).append( ') ' );
  }
}

/* Test if an element has a certain class
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 *
 * @deprecated:  Use $(element).hasClass() instead.
 */

window.hasClass = ( function() {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() {
    if ( document.getElementById( &quot;p-lang&quot; ) ) {
        var InterwikiLinks = document.getElementById( &quot;p-lang&quot; ).getElementsByTagName( &quot;li&quot; );

        for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + &quot;-fa&quot; ) ) {
                InterwikiLinks[i].className += &quot; FA&quot;;
                InterwikiLinks[i].title = &quot;This is a featured article in another language.&quot;;
            } else if ( document.getElementById( InterwikiLinks[i].className + &quot;-ga&quot; ) ) {
                InterwikiLinks[i].className += &quot; GA&quot;;
                InterwikiLinks[i].title = &quot;This is a good article in another language.&quot;;
            }
        }
    }
}

$( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode('&amp;nbsp;&amp;nbsp;'isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */
ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 */
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == &quot;Upload&quot; &amp;&amp; wgAction == &quot;view&quot;) {
    var oldDiv = document.getElementById(&quot;autoconfirmedusers&quot;),
        newDiv = document.getElementById(&quot;newusers&quot;);
    if (oldDiv &amp;&amp; newDiv) {
      if (typeof wgUserGroups == &quot;object&quot; &amp;&amp; wgUserGroups) {
        for (i = 0; i &lt; wgUserGroups.length; i++) {
          if (wgUserGroups[i] == &quot;autoconfirmed&quot;) {
            oldDiv.style.display = &quot;block&quot;;
            newDiv.style.display = &quot;none&quot;;
            return;
          }
        }
      }
      oldDiv.style.display = &quot;none&quot;;
      newDiv.style.display = &quot;block&quot;;
      return;
    }
  }
}
$(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing 

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != &quot;https://secure.wikimedia.org&quot;) &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript(&quot;MediaWiki:Common.js/IPv6.js&quot;);
}
**/

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro( name ) {
  $( '.editsection, #ca-edit' ).find( 'a' ).each( function( i, el ) {
    el.href = $(this).attr(&quot;href&quot;) + '&amp;editintro=' + name;
  });
}

if (wgNamespaceNumber === 0) {
  $(function(){
    if (document.getElementById('disambigbox')) {
      addEditIntro('Template:Disambig_editintro');
    }
  });

  $(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats) {
      return;
    }
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i &lt; cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/**
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if ( mw.config.get('wgServer') == 'https://secure.wikimedia.org' ) {
    /* Old secure server */
    importScript( 'MediaWiki:Common.js/secure.js');
} else if( document.location &amp;&amp; document.location.protocol  &amp;&amp; document.location.protocol == &quot;https:&quot; ) {
  /* New secure servers */
  importScript('MediaWiki:Common.js/secure new.js');
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>573</id>
      <timestamp>2012-07-15T00:00:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18345">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/**
 * Redirect User:Name/skin.js and skin.css to the current skin's pages
 * (unless the 'skin' page really exists)
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js
 * @rev: 2
 */
if ( mw.config.get( 'wgArticleId' ) === 0 &amp;&amp; mw.config.get( 'wgNamespaceNumber' ) == 2 ) {
	var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
	// Make sure there was a part before and after the slash
	// And that the latter is 'skin.js' or 'skin.css'
	if ( titleParts.length == 2 ) {
		var userSkinPage = titleParts.shift() + '/' + mw.config.get( 'skin' );
		if ( titleParts.slice(-1) == 'skin.js' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.js' );
		} else if ( titleParts.slice(-1) == 'skin.css' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.css' );
		}
	}
}

/** Map addPortletLink to mw.util 
 */
window.addPortletLink = function() {
    return mw.util.addPortletLink.apply( mw.util, arguments );
};

/** extract a URL parameter from the current URL **********
 *
 * @deprecated: Use mw.util.getParamValue with proper escaping
 */
window.getURLParamValue = function() {
    return mw.util.getParamValue.apply( mw.util, arguments );
};

/** &amp;withCSS= and &amp;withJS= URL parameters *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing personal .css or .js files
 */
var extraCSS = mw.util.getParamValue(&quot;withCSS&quot;);
if ( extraCSS &amp;&amp; extraCSS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.css$/) ) {
    importStylesheet(extraCSS);
}
var extraJS = mw.util.getParamValue(&quot;withJS&quot;);
if ( extraJS &amp;&amp; extraJS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$/) ) {
    importScript(extraJS);
}


/* Import more specific scripts if necessary */
if (wgAction == 'edit' || wgAction == 'submit' || wgPageName == 'Special:Upload') { //scripts specific to editing pages
    importScript('MediaWiki:Common.js/edit.js');
}
else if (mw.config.get('wgPageName') == 'Special:Watchlist') { //watchlist scripts
    mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=MediaWiki:Common.js/watchlist.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');
}

if ( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/**
 * WikiMiniAtlas
 *
 *  Description: WikiMiniAtlas is a popup click and drag world map.
 *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 *               The script itself is located on meta because it is used by many projects.
 *               See [[Meta:WikiMiniAtlas]] for more information. 
 *  Maintainers: [[User:Dschwen]]
 */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');

/* Scripts specific to Internet Explorer */
if ($.client.profile().name == 'msie') {
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    var fixIEScroll = function() {
        if (!oldWidth || docEl.clientWidth &gt; oldWidth) {
            doFixIEScroll();
        } else {
            setTimeout(doFixIEScroll, 1);
        }
        
        oldWidth = docEl.clientWidth;
    };
    
    var doFixIEScroll = function () {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4) ? &quot;hidden&quot; : &quot;&quot;;
    };
    
    document.attachEvent(&quot;onreadystatechange&quot;, fixIEScroll);
    document.attachEvent(&quot;onresize&quot;, fixIEScroll);
    
    // In print IE (7?) does not like line-height
    mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');

    // IE overflow bug
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
      + 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    // Use to fix right floating div/table inside tables
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');

    // Import scripts specific to Internet Explorer 6
    if ($.client.profile().versionBase == '6') {
        importScript('MediaWiki:Common.js/IE60Fixes.js');
    }
}

/* Fixes for Windows font rendering */
if ($.client.profile().platform == 'win') {
    mw.util.addCSS('.IPA, .Unicode { font-family: &quot;Arial Unicode MS&quot;, &quot;Lucida Sans Unicode&quot;; }');
}

/* Helper script for .hlist class in common.css
 * Maintainer: [[User:Edokter]]
 */
 
if ( $.client.profile().name == 'msie' ) {
  /* Add pseudo-selector class to last child list items in IE 8 */
  if ( $.client.profile().versionBase == '8' ) {
    $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
      .addClass( 'hlist-last-child' );
  }
  /* Generate interpuncts and parens for IE &lt; 8 */
  if ( $.client.profile().versionBase &lt; '8' ) {
    $( '.hlist' ).find( 'dt + dd, dt + dt' ).prev()
      .append( '&lt;b&gt;:&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dd + dd, dd + dt, li + li' ).prev()
      .append( '&lt;b&gt;·&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dl dl, ol ol, ul ul' )
      .prepend( '( ' ).append( ') ' );
  }
}

/* Test if an element has a certain class
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 *
 * @deprecated:  Use $(element).hasClass() instead.
 */

window.hasClass = ( function() {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() {
    if ( document.getElementById( &quot;p-lang&quot; ) ) {
        var InterwikiLinks = document.getElementById( &quot;p-lang&quot; ).getElementsByTagName( &quot;li&quot; );

        for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + &quot;-fa&quot; ) ) {
                InterwikiLinks[i].className += &quot; FA&quot;;
                InterwikiLinks[i].title = &quot;This is a featured article in another language.&quot;;
            } else if ( document.getElementById( InterwikiLinks[i].className + &quot;-ga&quot; ) ) {
                InterwikiLinks[i].className += &quot; GA&quot;;
                InterwikiLinks[i].title = &quot;This is a good article in another language.&quot;;
            }
        }
    }
}

$( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode('&amp;nbsp;&amp;nbsp;' + isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */
ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 */
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == &quot;Upload&quot; &amp;&amp; wgAction == &quot;view&quot;) {
    var oldDiv = document.getElementById(&quot;autoconfirmedusers&quot;),
        newDiv = document.getElementById(&quot;newusers&quot;);
    if (oldDiv &amp;&amp; newDiv) {
      if (typeof wgUserGroups == &quot;object&quot; &amp;&amp; wgUserGroups) {
        for (i = 0; i &lt; wgUserGroups.length; i++) {
          if (wgUserGroups[i] == &quot;autoconfirmed&quot;) {
            oldDiv.style.display = &quot;block&quot;;
            newDiv.style.display = &quot;none&quot;;
            return;
          }
        }
      }
      oldDiv.style.display = &quot;none&quot;;
      newDiv.style.display = &quot;block&quot;;
      return;
    }
  }
}
$(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing 

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != &quot;https://secure.wikimedia.org&quot;) &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript(&quot;MediaWiki:Common.js/IPv6.js&quot;);
}
**/

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro( name ) {
  $( '.editsection, #ca-edit' ).find( 'a' ).each( function( i, el ) {
    el.href = $(this).attr(&quot;href&quot;) + '&amp;editintro=' + name;
  });
}

if (wgNamespaceNumber === 0) {
  $(function(){
    if (document.getElementById('disambigbox')) {
      addEditIntro('Template:Disambig_editintro');
    }
  });

  $(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats) {
      return;
    }
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i &lt; cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/**
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if ( mw.config.get('wgServer') == 'https://secure.wikimedia.org' ) {
    /* Old secure server */
    importScript( 'MediaWiki:Common.js/secure.js');
} else if( document.location &amp;&amp; document.location.protocol  &amp;&amp; document.location.protocol == &quot;https:&quot; ) {
  /* New secure servers */
  importScript('MediaWiki:Common.js/secure new.js');
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>574</id>
      <timestamp>2012-07-15T00:01:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18352">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/**
 * Redirect User:Name/skin.js and skin.css to the current skin's pages
 * (unless the 'skin' page really exists)
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js
 * @rev: 2
 */
if ( mw.config.get( 'wgArticleId' ) === 0 &amp;&amp; mw.config.get( 'wgNamespaceNumber' ) == 2 ) {
	var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
	// Make sure there was a part before and after the slash
	// And that the latter is 'skin.js' or 'skin.css'
	if ( titleParts.length == 2 ) {
		var userSkinPage = titleParts.shift() + '/' + mw.config.get( 'skin' );
		if ( titleParts.slice(-1) == 'skin.js' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.js' );
		} else if ( titleParts.slice(-1) == 'skin.css' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.css' );
		}
	}
}

/** Map addPortletLink to mw.util 
 */
window.addPortletLink = function() {
    return mw.util.addPortletLink.apply( mw.util, arguments );
};

/** extract a URL parameter from the current URL **********
 *
 * @deprecated: Use mw.util.getParamValue with proper escaping
 */
window.getURLParamValue = function() {
    return mw.util.getParamValue.apply( mw.util, arguments );
};

/** &amp;withCSS= and &amp;withJS= URL parameters *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing personal .css or .js files
 */
var extraCSS = mw.util.getParamValue(&quot;withCSS&quot;);
if ( extraCSS &amp;&amp; extraCSS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.css$/) ) {
    importStylesheet(extraCSS);
}
var extraJS = mw.util.getParamValue(&quot;withJS&quot;);
if ( extraJS &amp;&amp; extraJS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$/) ) {
    importScript(extraJS);
}


/* Import more specific scripts if necessary */
if (wgAction == 'edit' || wgAction == 'submit' || wgPageName == 'Special:Upload') { //scripts specific to editing pages
    importScript('MediaWiki:Common.js/edit.js');
}
else if (mw.config.get('wgPageName') == 'Special:Watchlist') { //watchlist scripts
    mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=MediaWiki:Common.js/watchlist.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');
}

if ( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/**
 * WikiMiniAtlas
 *
 *  Description: WikiMiniAtlas is a popup click and drag world map.
 *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 *               The script itself is located on meta because it is used by many projects.
 *               See [[Meta:WikiMiniAtlas]] for more information. 
 *  Maintainers: [[User:Dschwen]]
 */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');

/* Scripts specific to Internet Explorer */
if ($.client.profile().name == 'msie') {
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    var fixIEScroll = function() {
        if (!oldWidth || docEl.clientWidth &gt; oldWidth) {
            doFixIEScroll();
        } else {
            setTimeout(doFixIEScroll, 1);
        }
        
        oldWidth = docEl.clientWidth;
    };
    
    var doFixIEScroll = function () {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4) ? &quot;hidden&quot; : &quot;&quot;;
    };
    
    document.attachEvent(&quot;onreadystatechange&quot;, fixIEScroll);
    document.attachEvent(&quot;onresize&quot;, fixIEScroll);
    
    // In print IE (7?) does not like line-height
    mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');

    // IE overflow bug
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
      + 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    // Use to fix right floating div/table inside tables
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');

    // Import scripts specific to Internet Explorer 6
    if ($.client.profile().versionBase == '6') {
        importScript('MediaWiki:Common.js/IE60Fixes.js');
    }
}

/* Fixes for Windows font rendering */
if ($.client.profile().platform == 'win') {
    mw.util.addCSS('.IPA, .Unicode { font-family: &quot;Arial Unicode MS&quot;, &quot;Lucida Sans Unicode&quot;; }');
}

/* Helper script for .hlist class in common.css
 * Maintainer: [[User:Edokter]]
 */
 
if ( $.client.profile().name == 'msie' ) {
  /* Add pseudo-selector class to last child list items in IE 8 */
  if ( $.client.profile().versionBase == '8' ) {
    $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
      .addClass( 'hlist-last-child' );
  }
  /* Generate interpuncts and parens for IE &lt; 8 */
  if ( $.client.profile().versionBase &lt; '8' ) {
    $( '.hlist' ).find( 'dt + dd, dt + dt' ).prev()
      .append( '&lt;b&gt;:&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dd + dd, dd + dt, li + li' ).prev()
      .append( '&lt;b&gt;·&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dl dl, ol ol, ul ul' )
      .prepend( '( ' ).append( ') ' );
  }
}

/* Test if an element has a certain class
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 *
 * @deprecated:  Use $(element).hasClass() instead.
 */

window.hasClass = ( function() {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() {
    if ( document.getElementById( &quot;p-lang&quot; ) ) {
        var InterwikiLinks = document.getElementById( &quot;p-lang&quot; ).getElementsByTagName( &quot;li&quot; );

        for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + &quot;-fa&quot; ) ) {
                InterwikiLinks[i].className += &quot; FA&quot;;
                InterwikiLinks[i].title = &quot;This is a featured article in another language.&quot;;
            } else if ( document.getElementById( InterwikiLinks[i].className + &quot;-ga&quot; ) ) {
                InterwikiLinks[i].className += &quot; GA&quot;;
                InterwikiLinks[i].title = &quot;This is a good article in another language.&quot;;
            }
        }
    }
}

$( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '&amp;nbsp;&amp;nbsp;[' + collapseCaption + ']';
var NavigationBarShow = '&amp;nbsp;&amp;nbsp;[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */
ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 */
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == &quot;Upload&quot; &amp;&amp; wgAction == &quot;view&quot;) {
    var oldDiv = document.getElementById(&quot;autoconfirmedusers&quot;),
        newDiv = document.getElementById(&quot;newusers&quot;);
    if (oldDiv &amp;&amp; newDiv) {
      if (typeof wgUserGroups == &quot;object&quot; &amp;&amp; wgUserGroups) {
        for (i = 0; i &lt; wgUserGroups.length; i++) {
          if (wgUserGroups[i] == &quot;autoconfirmed&quot;) {
            oldDiv.style.display = &quot;block&quot;;
            newDiv.style.display = &quot;none&quot;;
            return;
          }
        }
      }
      oldDiv.style.display = &quot;none&quot;;
      newDiv.style.display = &quot;block&quot;;
      return;
    }
  }
}
$(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing 

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != &quot;https://secure.wikimedia.org&quot;) &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript(&quot;MediaWiki:Common.js/IPv6.js&quot;);
}
**/

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro( name ) {
  $( '.editsection, #ca-edit' ).find( 'a' ).each( function( i, el ) {
    el.href = $(this).attr(&quot;href&quot;) + '&amp;editintro=' + name;
  });
}

if (wgNamespaceNumber === 0) {
  $(function(){
    if (document.getElementById('disambigbox')) {
      addEditIntro('Template:Disambig_editintro');
    }
  });

  $(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats) {
      return;
    }
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i &lt; cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/**
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if ( mw.config.get('wgServer') == 'https://secure.wikimedia.org' ) {
    /* Old secure server */
    importScript( 'MediaWiki:Common.js/secure.js');
} else if( document.location &amp;&amp; document.location.protocol  &amp;&amp; document.location.protocol == &quot;https:&quot; ) {
  /* New secure servers */
  importScript('MediaWiki:Common.js/secure new.js');
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
    <revision>
      <id>575</id>
      <timestamp>2012-07-15T00:01:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="18328">/**
 * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
 * loaded for all users on every wiki page. If possible create a gadget that is
 * enabled by default instead of adding it here (since gadgets are fully
 * optimized ResourceLoader modules with possibility to add dependencies etc.)
 *
 * Since common.js isn't a gadget, there is no place to declare its
 * dependencies, so we have to lazy load them with mw.loader.using on demand and
 * then execute the rest in the callback. In most cases these dependencies will
 * be loaded (or loading) already and the callback will not be delayed. In case a
 * dependency hasn't arrived yet it'll make sure those are loaded before this.
 */
mw.loader.using( 'mediawiki.util', function() {
/* Begin of mw.loader.using callback */

/**
 * Redirect User:Name/skin.js and skin.css to the current skin's pages
 * (unless the 'skin' page really exists)
 * @source: http://www.mediawiki.org/wiki/Snippets/Redirect_skin.js
 * @rev: 2
 */
if ( mw.config.get( 'wgArticleId' ) === 0 &amp;&amp; mw.config.get( 'wgNamespaceNumber' ) == 2 ) {
	var titleParts = mw.config.get( 'wgPageName' ).split( '/' );
	// Make sure there was a part before and after the slash
	// And that the latter is 'skin.js' or 'skin.css'
	if ( titleParts.length == 2 ) {
		var userSkinPage = titleParts.shift() + '/' + mw.config.get( 'skin' );
		if ( titleParts.slice(-1) == 'skin.js' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.js' );
		} else if ( titleParts.slice(-1) == 'skin.css' ) {
			window.location.href = mw.util.wikiGetlink( userSkinPage + '.css' );
		}
	}
}

/** Map addPortletLink to mw.util 
 */
window.addPortletLink = function() {
    return mw.util.addPortletLink.apply( mw.util, arguments );
};

/** extract a URL parameter from the current URL **********
 *
 * @deprecated: Use mw.util.getParamValue with proper escaping
 */
window.getURLParamValue = function() {
    return mw.util.getParamValue.apply( mw.util, arguments );
};

/** &amp;withCSS= and &amp;withJS= URL parameters *******
 * Allow to try custom scripts from MediaWiki space 
 * without editing personal .css or .js files
 */
var extraCSS = mw.util.getParamValue(&quot;withCSS&quot;);
if ( extraCSS &amp;&amp; extraCSS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.css$/) ) {
    importStylesheet(extraCSS);
}
var extraJS = mw.util.getParamValue(&quot;withJS&quot;);
if ( extraJS &amp;&amp; extraJS.match(/^MediaWiki:[^&amp;&lt;&gt;=%]*\.js$/) ) {
    importScript(extraJS);
}


/* Import more specific scripts if necessary */
if (wgAction == 'edit' || wgAction == 'submit' || wgPageName == 'Special:Upload') { //scripts specific to editing pages
    importScript('MediaWiki:Common.js/edit.js');
}
else if (mw.config.get('wgPageName') == 'Special:Watchlist') { //watchlist scripts
    mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=MediaWiki:Common.js/watchlist.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');
}

if ( wgNamespaceNumber == 6 ) {
    importScript('MediaWiki:Common.js/file.js');
}

/**
 * WikiMiniAtlas
 *
 *  Description: WikiMiniAtlas is a popup click and drag world map.
 *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
 *               The script itself is located on meta because it is used by many projects.
 *               See [[Meta:WikiMiniAtlas]] for more information. 
 *  Maintainers: [[User:Dschwen]]
 */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&amp;action=raw&amp;ctype=text/javascript&amp;smaxage=21600&amp;maxage=86400');

/* Scripts specific to Internet Explorer */
if ($.client.profile().name == 'msie') {
    /** Internet Explorer bug fix **************************************************
     *
     *  Description: Fixes IE horizontal scrollbar bug
     *  Maintainers: [[User:Tom-]]?
     */
    
    var oldWidth;
    var docEl = document.documentElement;
    
    var fixIEScroll = function() {
        if (!oldWidth || docEl.clientWidth &gt; oldWidth) {
            doFixIEScroll();
        } else {
            setTimeout(doFixIEScroll, 1);
        }
        
        oldWidth = docEl.clientWidth;
    };
    
    var doFixIEScroll = function () {
        docEl.style.overflowX = (docEl.scrollWidth - docEl.clientWidth &lt; 4) ? &quot;hidden&quot; : &quot;&quot;;
    };
    
    document.attachEvent(&quot;onreadystatechange&quot;, fixIEScroll);
    document.attachEvent(&quot;onresize&quot;, fixIEScroll);
    
    // In print IE (7?) does not like line-height
    mw.util.addCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; } }');

    // IE overflow bug
    mw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } '
      + 'div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');

    // IE zoomfix
    // Use to fix right floating div/table inside tables
    mw.util.addCSS('.iezoomfix div, .iezoomfix table { zoom: 1; }');

    // Import scripts specific to Internet Explorer 6
    if ($.client.profile().versionBase == '6') {
        importScript('MediaWiki:Common.js/IE60Fixes.js');
    }
}

/* Fixes for Windows font rendering */
if ($.client.profile().platform == 'win') {
    mw.util.addCSS('.IPA, .Unicode { font-family: &quot;Arial Unicode MS&quot;, &quot;Lucida Sans Unicode&quot;; }');
}

/* Helper script for .hlist class in common.css
 * Maintainer: [[User:Edokter]]
 */
 
if ( $.client.profile().name == 'msie' ) {
  /* Add pseudo-selector class to last child list items in IE 8 */
  if ( $.client.profile().versionBase == '8' ) {
    $( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' )
      .addClass( 'hlist-last-child' );
  }
  /* Generate interpuncts and parens for IE &lt; 8 */
  if ( $.client.profile().versionBase &lt; '8' ) {
    $( '.hlist' ).find( 'dt + dd, dt + dt' ).prev()
      .append( '&lt;b&gt;:&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dd + dd, dd + dt, li + li' ).prev()
      .append( '&lt;b&gt;·&lt;/b&gt; ' );
    $( '.hlist' ).find( 'dl dl, ol ol, ul ul' )
      .prepend( '( ' ).append( ') ' );
  }
}

/* Test if an element has a certain class
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 *
 * @deprecated:  Use $(element).hasClass() instead.
 */

window.hasClass = ( function() {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp(&quot;(?:\\s|^)&quot; + className + &quot;(?:\\s|$)&quot;))).test(element.className);
    };
})();


/** Interwiki links to featured articles ***************************************
 *
 *  Description: Highlights interwiki links to featured articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: [[User:R. Koot]]
 */

function LinkFA() {
    if ( document.getElementById( &quot;p-lang&quot; ) ) {
        var InterwikiLinks = document.getElementById( &quot;p-lang&quot; ).getElementsByTagName( &quot;li&quot; );

        for ( var i = 0; i &lt; InterwikiLinks.length; i++ ) {
            if ( document.getElementById( InterwikiLinks[i].className + &quot;-fa&quot; ) ) {
                InterwikiLinks[i].className += &quot; FA&quot;;
                InterwikiLinks[i].title = &quot;This is a featured article in another language.&quot;;
            } else if ( document.getElementById( InterwikiLinks[i].className + &quot;-ga&quot; ) ) {
                InterwikiLinks[i].className += &quot; GA&quot;;
                InterwikiLinks[i].title = &quot;This is a good article in another language.&quot;;
            }
        }
    }
}

$( LinkFA );


/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */

var autoCollapse = 2;
var collapseCaption = &quot;hide&quot;;
var expandCaption = &quot;show&quot;;

window.collapseTable = function( tableIndex ){
    var Button = document.getElementById( &quot;collapseButton&quot; + tableIndex );
    var Table = document.getElementById( &quot;collapsibleTable&quot; + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = &quot;none&quot;;
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i &lt; Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}

function createCollapseButtons(){
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( &quot;table&quot; );

    for ( var i = 0; i &lt; Tables.length; i++ ) {
        if ( hasClass( Tables[i], &quot;collapsible&quot; ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( &quot;tr&quot; )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( &quot;th&quot; )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( &quot;id&quot;, &quot;collapsibleTable&quot; + tableIndex );

            var Button     = document.createElement( &quot;span&quot; );
            var ButtonLink = document.createElement( &quot;a&quot; );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.className = &quot;collapseButton&quot;;  //Styles are declared in Common.css

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( &quot;id&quot;, &quot;collapseButton&quot; + tableIndex );
            ButtonLink.setAttribute( &quot;href&quot;, &quot;#&quot; );
            addHandler( ButtonLink,  &quot;click&quot;, new Function( &quot;evt&quot;, &quot;collapseTable(&quot; + tableIndex + &quot; ); return killEvt( evt );&quot;) );
            ButtonLink.appendChild( ButtonText );

            Button.appendChild( document.createTextNode( &quot;[&quot; ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( &quot;]&quot; ) );

            Header.insertBefore( Button, Header.firstChild );
            tableIndex++;
        }
    }

    for ( var i = 0;  i &lt; tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], &quot;collapsed&quot; ) || ( tableIndex &gt;= autoCollapse &amp;&amp; hasClass( NavigationBoxes[i], &quot;autocollapse&quot; ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], &quot;innercollapse&quot; ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, &quot;outercollapse&quot; ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}

$( createCollapseButtons );


/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */

// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';

// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
window.toggleNavigationBar = function(indexNavigationBar){
    var NavToggle = document.getElementById(&quot;NavToggle&quot; + indexNavigationBar);
    var NavFrame = document.getElementById(&quot;NavFrame&quot; + indexNavigationBar);

    if (!NavFrame || !NavToggle) {
        return false;
    }

    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;

    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if (hasClass(NavChild, 'NavContent') || hasClass(NavChild, 'NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}

// adds show/hide-button to navigation bars
function createNavigationBarToggleButton(){
    var indexNavigationBar = 0;
    // iterate over all &lt; div &gt;-elements 
    var divs = document.getElementsByTagName(&quot;div&quot;);
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if (hasClass(NavFrame, &quot;NavFrame&quot;)) {

            indexNavigationBar++;
            var NavToggle = document.createElement(&quot;a&quot;);
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

            var isCollapsed = hasClass( NavFrame, &quot;collapsed&quot; );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style=&quot;display:none&quot;
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * &quot;collapsed&quot; to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null &amp;&amp; !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);

            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j &lt; NavFrame.childNodes.length; j++) {
                if (hasClass(NavFrame.childNodes[j], &quot;NavHead&quot;)) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}

$( createNavigationBarToggleButton );


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (wgPageName == 'Main_Page' || wgPageName == 'Talk:Main_Page') {
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
            'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias');
    });
}


/** Table sorting fixes ************************************************
  *
  *  Description: Disables code in table sorting routine to set classes on even/odd rows
  *  Maintainers: [[User:Random832]]
  */
ts_alternate_row_colors = false;


/***** uploadwizard_newusers ********
 * Switches in a message for non-autoconfirmed users at [[Wikipedia:Upload]]
 *
 *  Maintainers: [[User:Krimpet]]
 */
function uploadwizard_newusers() {
  if (wgNamespaceNumber == 4 &amp;&amp; wgTitle == &quot;Upload&quot; &amp;&amp; wgAction == &quot;view&quot;) {
    var oldDiv = document.getElementById(&quot;autoconfirmedusers&quot;),
        newDiv = document.getElementById(&quot;newusers&quot;);
    if (oldDiv &amp;&amp; newDiv) {
      if (typeof wgUserGroups == &quot;object&quot; &amp;&amp; wgUserGroups) {
        for (i = 0; i &lt; wgUserGroups.length; i++) {
          if (wgUserGroups[i] == &quot;autoconfirmed&quot;) {
            oldDiv.style.display = &quot;block&quot;;
            newDiv.style.display = &quot;none&quot;;
            return;
          }
        }
      }
      oldDiv.style.display = &quot;none&quot;;
      newDiv.style.display = &quot;block&quot;;
      return;
    }
  }
}
$(uploadwizard_newusers);


/** IPv6 AAAA connectivity testing 

var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != &quot;https://secure.wikimedia.org&quot;) &amp;&amp; (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
    importScript(&quot;MediaWiki:Common.js/IPv6.js&quot;);
}
**/

/** Magic editintros ****************************************************
 *
 *  Description: Adds editintros on disambiguation pages and BLP pages.
 *  Maintainers: [[User:RockMFR]]
 */

function addEditIntro( name ) {
  $( '.editsection, #ca-edit' ).find( 'a' ).each( function( i, el ) {
    el.href = $(this).attr(&quot;href&quot;) + '&amp;editintro=' + name;
  });
}

if (wgNamespaceNumber === 0) {
  $(function(){
    if (document.getElementById('disambigbox')) {
      addEditIntro('Template:Disambig_editintro');
    }
  });

  $(function(){
    var cats = document.getElementById('mw-normal-catlinks');
    if (!cats) {
      return;
    }
    cats = cats.getElementsByTagName('a');
    for (var i = 0; i &lt; cats.length; i++) {
      if (cats[i].title == 'Category:Living people' || cats[i].title == 'Category:Possibly living people') {
        addEditIntro('Template:BLP_editintro');
        break;
      }
    }
  });
}

/**
 * Description: Stay on the secure server as much as possible
 * Maintainers: [[User:TheDJ]]
 */
if ( mw.config.get('wgServer') == 'https://secure.wikimedia.org' ) {
    /* Old secure server */
    importScript( 'MediaWiki:Common.js/secure.js');
} else if( document.location &amp;&amp; document.location.protocol  &amp;&amp; document.location.protocol == &quot;https:&quot; ) {
  /* New secure servers */
  importScript('MediaWiki:Common.js/secure new.js');
}

/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:Disclaimers</title>
    <ns>8</ns>
    <id>161</id>
      <sha1>6za6z27cqk2qatlebqsiz85czbjf3rd</sha1>
    <revision>
      <id>1986</id>
      <timestamp>2012-07-27T13:18:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;-&quot;</comment>
      <text xml:space="preserve" bytes="1">-</text>
    </revision>
    <revision>
      <id>2891</id>
      <timestamp>2012-11-23T00:54:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
    <revision>
      <id>2892</id>
      <timestamp>2012-11-23T00:55:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1">-</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:Privacy</title>
    <ns>8</ns>
    <id>160</id>
      <sha1>6za6z27cqk2qatlebqsiz85czbjf3rd</sha1>
    <revision>
      <id>1985</id>
      <timestamp>2012-07-27T13:18:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;-&quot;</comment>
      <text xml:space="preserve" bytes="1">-</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:Rss-feed</title>
    <ns>8</ns>
    <id>312</id>
      <sha1>rpqjmucfhxl8ndpia32gva76my5z8my</sha1>
    <revision>
      <id>2909</id>
      <timestamp>2012-11-23T03:07:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;'''&lt;span class='plainlinks'&gt;[{{{link}}} {{{title}}}]&lt;/span&gt;'''{{#if: {{{description|}}}|: {{{description}}}}}{{#if: {{{author|}}} | {{#if: {{{date|}}} |: &amp;mdash; {{{author}}} ...&quot;</comment>
      <text xml:space="preserve" bytes="271">'''&lt;span class='plainlinks'&gt;[{{{link}}} {{{title}}}]&lt;/span&gt;'''{{#if: {{{description|}}}|: {{{description}}}}}{{#if: {{{author|}}} | {{#if: {{{date|}}} |: &amp;mdash; {{{author}}} {{{date}}}}} | {{#if: {{{author|}}}|: &amp;mdash; {{{author}}}}} {{#if: {{{date|}}}|:{{{date}}}}}|}}</text>
    </revision>
  </page>
  <page>
    <title>MediaWiki:Sidebar</title>
    <ns>8</ns>
    <id>140</id>
      <sha1>tqu5a51udkp6mxfotf3llf3wdp0t90s</sha1>
    <revision>
      <id>1752</id>
      <timestamp>2012-07-24T09:25:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot; * navigation ** Main_Page|Wiki main page ** portal-url|portal ** recentchanges-url|recentchanges ** randompage-url|randompage * SEARCH * TOOLBOX * LANGUAGES&quot;</comment>
      <text xml:space="preserve" bytes="157">
* navigation
** Main_Page|Wiki main page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1753</id>
      <timestamp>2012-07-24T09:25:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="152">
* navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1754</id>
      <timestamp>2012-07-24T09:25:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="152">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1755</id>
      <timestamp>2012-07-24T09:30:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="153">
* new heading
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1756</id>
      <timestamp>2012-07-24T09:30:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="166">
* new heading
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1758</id>
      <timestamp>2012-07-24T09:31:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="151">* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1759</id>
      <timestamp>2012-07-24T09:32:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="165">* Navigation
** Blood Wiki
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1760</id>
      <timestamp>2012-07-24T09:32:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="179">* Navigation
** Blood Wiki
** Blood Wiki
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1761</id>
      <timestamp>2012-07-24T09:32:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="151">* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1762</id>
      <timestamp>2012-07-24T09:35:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="181">* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1763</id>
      <timestamp>2012-07-24T09:35:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="192">Blood Wiki
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1764</id>
      <timestamp>2012-07-24T09:35:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="203">Blood Wiki
Blood Wiki
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1765</id>
      <timestamp>2012-07-24T09:35:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="182">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1766</id>
      <timestamp>2012-07-24T09:36:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="183">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage

* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1767</id>
      <timestamp>2012-07-24T09:36:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="184">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
*
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1768</id>
      <timestamp>2012-07-24T09:36:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="185">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
**
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1769</id>
      <timestamp>2012-07-24T09:36:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="192">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
** &amp;nbsp;
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1770</id>
      <timestamp>2012-07-24T09:36:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="184">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage


* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
    <revision>
      <id>1771</id>
      <timestamp>2012-07-24T09:36:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="182">
* Navigation
** Main_Page|Main Page
** portal-url|portal
** recentchanges-url|recentchanges
** Special:NewPages|New pages
** randompage-url|randompage
* SEARCH
* TOOLBOX
* LANGUAGES</text>
    </revision>
  </page>
  <page>
    <title>NSX</title>
    <ns>0</ns>
    <id>9</id>
      <sha1>hw0i4gx2e1c8t2pqx349l4083eyxcye</sha1>
    <revision>
      <id>72</id>
      <timestamp>2012-07-02T18:08:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;.NSX files is INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.  More than 1 value could be associated with a key.  Example of .NSX file:  [g...&quot;</comment>
      <text xml:space="preserve" bytes="328">.NSX files is INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.

More than 1 value could be associated with a key.

Example of .NSX file:
 [group1]
 key1=value1 # comment
 key2=value2
 [group2]key=parm1&amp;|parm2
 key1=x|y
 key2=foo|bar

NSX files are part of [[NetherMenu framework | NetherMenu]]</text>
    </revision>
    <revision>
      <id>75</id>
      <timestamp>2012-07-02T18:09:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="329">.NSX files is INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.

More than 1 value could be associated with a key.

Example of .NSX file:
 [group1]
 key1=value1 # comment
 key2=value2
 [group2]key=parm1&amp;|parm2
 key1=x|y
 key2=foo|bar

NSX files are part of [[NetherMenu | NetherMenu framework ]]</text>
    </revision>
    <revision>
      <id>76</id>
      <timestamp>2012-07-02T18:10:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="353">.NSX files is INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.

More than 1 value could be associated with a key (so can store a tables).

Example of .NSX file:
 [group1]
 key1=value1 # comment
 key2=value2
 [group2]key=parm1&amp;|parm2
 key1=x|y
 key2=foo|bar

NSX files are part of [[NetherMenu | NetherMenu framework ]]</text>
    </revision>
    <revision>
      <id>79</id>
      <timestamp>2012-07-02T18:12:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="380">.NSX files is INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.

More than 1 value could be associated with a key (so can store a tables).

Example of .NSX file:
 [group1]
 key1=value1 # comment
 key2=value2
 [group2]key=parm1&amp;|parm2
 key1=x|y
 key2=foo|bar

NSX files are part of [[NetherMenu | NetherMenu framework ]]

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>989</id>
      <timestamp>2012-07-17T05:15:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="377">.NSX files is INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.

More than 1 value could be associated with a key (can store a tables).

Example of .NSX file:
 [group1]
 key1=value1 # comment
 key2=value2
 [group2]key=parm1&amp;|parm2
 key1=x|y
 key2=foo|bar

NSX files are part of [[NetherMenu | NetherMenu framework ]]

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>992</id>
      <timestamp>2012-07-17T05:16:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="363">INI-like text files aiming to store configuration in the form of group-&gt;key-&gt;value.

More than 1 value could be associated with a key (can store a tables).

Example of .NSX file:
 [group1]
 key1=value1 # comment
 key2=value2
 [group2]key=parm1&amp;|parm2
 key1=x|y
 key2=foo|bar

NSX files are part of [[NetherMenu | NetherMenu framework ]]

[[Category:File formats]]</text>
    </revision>
  </page>
  <page>
    <title>NSX (QFont)</title>
    <ns>0</ns>
    <id>4</id>
      <sha1>bu0li3rvto1r7bxbm6sk64i19hsef5i</sha1>
    <revision>
      <id>26</id>
      <timestamp>2012-07-02T13:43:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;= Introduction =  .QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).  Example of .QFONT file content...&quot;</comment>
      <text xml:space="preserve" bytes="397">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =</text>
    </revision>
    <revision>
      <id>29</id>
      <timestamp>2012-07-02T13:46:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="424">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>31</id>
      <timestamp>2012-07-02T13:47:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="453">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

{{Id Software file formats}}
[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>32</id>
      <timestamp>2012-07-02T13:48:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="424">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>33</id>
      <timestamp>2012-07-02T13:48:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="397">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =</text>
    </revision>
    <revision>
      <id>34</id>
      <timestamp>2012-07-02T13:48:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="424">[[Category:File formats]]

= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =</text>
    </revision>
    <revision>
      <id>35</id>
      <timestamp>2012-07-02T13:48:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="424">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>47</id>
      <timestamp>2012-07-02T15:15:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="406">.QFONT files are [[NSX|.NSX scripts]] that holds parameters for Blood Omnicide font draw overlay (a QuakeC interface module).

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>48</id>
      <timestamp>2012-07-02T15:35:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1506">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

==== type ''x'' ====
Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separatepic).

==== face ''path'' ====
Path to the glyphs map which have different value based on font renderer type:

* for ascii conchars its path to conchars map.
* for freetype is path to .TTF/.OTF file.
* for glyph renderer it is name of glyph table group.

==== brightness ''x'' ====

Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.

==== scale ''x'' ''y'' ====

Two floating point values storing horizontal and vertical scale of font chars.

Applies to all renderer types.

==== width ''x'' ====

X component of scale.

==== height ''y'' ====

Y component of scale.

==== respath ''path'' ====

Path to font resources. Default path is folder named as qfont file in same folder.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>49</id>
      <timestamp>2012-07-02T15:36:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* type x */</comment>
      <text xml:space="preserve" bytes="1518">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

==== type ''x'' ====
Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).

==== face ''path'' ====
Path to the glyphs map which have different value based on font renderer type:

* for ascii conchars its path to conchars map.
* for freetype is path to .TTF/.OTF file.
* for glyph renderer it is name of glyph table group.

==== brightness ''x'' ====

Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.

==== scale ''x'' ''y'' ====

Two floating point values storing horizontal and vertical scale of font chars.

Applies to all renderer types.

==== width ''x'' ====

X component of scale.

==== height ''y'' ====

Y component of scale.

==== respath ''path'' ====

Path to font resources. Default path is folder named as qfont file in same folder.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>50</id>
      <timestamp>2012-07-02T15:51:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* respath path */</comment>
      <text xml:space="preserve" bytes="1525">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

==== type ''x'' ====
Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).

==== face ''path'' ====
Path to the glyphs map which have different value based on font renderer type:

* for ascii conchars its path to conchars map.
* for freetype is path to .TTF/.OTF file.
* for glyph renderer it is name of glyph table group.

==== brightness ''x'' ====

Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.

==== scale ''x'' ''y'' ====

Two floating point values storing horizontal and vertical scale of font chars.

Applies to all renderer types.

==== width ''x'' ====

X component of scale.

==== height ''y'' ====

Y component of scale.

==== respath ''path'' ====

Path to font resources. Default path is sub-folder named as qfont file without extension.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>51</id>
      <timestamp>2012-07-02T16:22:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2557">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

==== type ''x'' ====
Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).

==== face ''path'' ====
Path to the font face group.

==== brightness ''x'' ====

Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.

==== scale ''x'' ''y'' ====

Two floating point values storing horizontal and vertical scale of font chars.

Applies to all renderer types.

==== width ''x'' ====

X component of scale.

==== height ''y'' ====

Y component of scale.

==== respath ''path'' ====

Path to font resources. Default path is sub-folder named as qfont file without extension.

== face group for freetype font ==

==== sizes &quot;size1 size2 size3...&quot; ====

Which glyph sizes to render (for different size fonts).

Default value is &quot;16 24&quot;.

==== slot &quot;x&quot; ====

Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.

==== glyphs &quot;string&quot; ====

Engine will render font pages containing this string chars.

==== r_antialias &quot;0/1&quot; ====

Toggles antialiasing for font pages renderer.

==== r_hinting &quot;0/1&quot; ====

Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.


	
				if (key == &quot;r_antialias&quot;)  { r_antialias = stof(val); continue; }
				if (key == &quot;r_hinting&quot;)    { r_hinting = stof(val); continue; }
				if (key == &quot;r_shadow&quot;)     { r_outline = stof(val); continue; }
				if (key == &quot;r_shadowblur&quot;) { r_outlineblur = stof(val); continue; }
				if (key == &quot;r_shadowofs&quot;)  { r_outlineofs = stov(val); continue; }
				if (key == &quot;r_charcushion&quot;){ r_charcushion = stof(val); continue; }
				if (key == &quot;r_charscale&quot;)  { r_charscale = stof(val); continue; }

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>52</id>
      <timestamp>2012-07-02T16:28:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2572">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

==== type=''x'' ====
Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).

==== face=''path'' ====
Path to the font face group.

==== brightness=''x'' ====

Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.

==== scale=''x'' ''y'' ====

Two floating point values storing horizontal and vertical scale of font chars.

Applies to all renderer types.

==== width=''x'' ====

X component of scale.

==== height=''y'' ====

Y component of scale.

==== respath=''path'' ====

Path to font resources. Default path is sub-folder named as qfont file without extension.

== face group for freetype font ==

==== sizes=''size1 size2 size3...'' ====

Which glyph sizes to render (for different size fonts).

Default value is &quot;16 24&quot;.

==== slot=''x'' ====

Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.

==== glyphs=''string'' ====

Engine will render font pages containing this string chars.

==== r_antialias=''0/1'' ====

Toggles antialiasing for font pages renderer.

==== r_hinting=''0/1/2/3'' ====

Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.



	
				if (key == &quot;r_antialias&quot;)  { r_antialias = stof(val); continue; }
				if (key == &quot;r_hinting&quot;)    { r_hinting = stof(val); continue; }
				if (key == &quot;r_shadow&quot;)     { r_outline = stof(val); continue; }
				if (key == &quot;r_shadowblur&quot;) { r_outlineblur = stof(val); continue; }
				if (key == &quot;r_shadowofs&quot;)  { r_outlineofs = stov(val); continue; }
				if (key == &quot;r_charcushion&quot;){ r_charcushion = stof(val); continue; }
				if (key == &quot;r_charscale&quot;)  { r_charscale = stof(val); continue; }

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>53</id>
      <timestamp>2012-07-02T16:33:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2252">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;20&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
!Key
!Value
!Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|}





	
				if (key == &quot;r_antialias&quot;)  { r_antialias = stof(val); continue; }
				if (key == &quot;r_hinting&quot;)    { r_hinting = stof(val); continue; }
				if (key == &quot;r_shadow&quot;)     { r_outline = stof(val); continue; }
				if (key == &quot;r_shadowblur&quot;) { r_outlineblur = stof(val); continue; }
				if (key == &quot;r_shadowofs&quot;)  { r_outlineofs = stov(val); continue; }
				if (key == &quot;r_charcushion&quot;){ r_charcushion = stof(val); continue; }
				if (key == &quot;r_charscale&quot;)  { r_charscale = stof(val); continue; }

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>54</id>
      <timestamp>2012-07-02T16:33:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [qfont] group */</comment>
      <text xml:space="preserve" bytes="2251">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;8&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
!Key
!Value
!Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|}





	
				if (key == &quot;r_antialias&quot;)  { r_antialias = stof(val); continue; }
				if (key == &quot;r_hinting&quot;)    { r_hinting = stof(val); continue; }
				if (key == &quot;r_shadow&quot;)     { r_outline = stof(val); continue; }
				if (key == &quot;r_shadowblur&quot;) { r_outlineblur = stof(val); continue; }
				if (key == &quot;r_shadowofs&quot;)  { r_outlineofs = stov(val); continue; }
				if (key == &quot;r_charcushion&quot;){ r_charcushion = stof(val); continue; }
				if (key == &quot;r_charscale&quot;)  { r_charscale = stof(val); continue; }

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>55</id>
      <timestamp>2012-07-02T16:34:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [qfont] group */</comment>
      <text xml:space="preserve" bytes="2251">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
!Key
!Value
!Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|}





	
				if (key == &quot;r_antialias&quot;)  { r_antialias = stof(val); continue; }
				if (key == &quot;r_hinting&quot;)    { r_hinting = stof(val); continue; }
				if (key == &quot;r_shadow&quot;)     { r_outline = stof(val); continue; }
				if (key == &quot;r_shadowblur&quot;) { r_outlineblur = stof(val); continue; }
				if (key == &quot;r_shadowofs&quot;)  { r_outlineofs = stov(val); continue; }
				if (key == &quot;r_charcushion&quot;){ r_charcushion = stof(val); continue; }
				if (key == &quot;r_charscale&quot;)  { r_charscale = stof(val); continue; }

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>56</id>
      <timestamp>2012-07-02T16:39:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [qfont] group */</comment>
      <text xml:space="preserve" bytes="2256">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
!Key
!Value
!Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.

Applies to all renderer types.
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|}





	
				if (key == &quot;r_antialias&quot;)  { r_antialias = stof(val); continue; }
				if (key == &quot;r_hinting&quot;)    { r_hinting = stof(val); continue; }
				if (key == &quot;r_shadow&quot;)     { r_outline = stof(val); continue; }
				if (key == &quot;r_shadowblur&quot;) { r_outlineblur = stof(val); continue; }
				if (key == &quot;r_shadowofs&quot;)  { r_outlineofs = stov(val); continue; }
				if (key == &quot;r_charcushion&quot;){ r_charcushion = stof(val); continue; }
				if (key == &quot;r_charscale&quot;)  { r_charscale = stof(val); continue; }

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>57</id>
      <timestamp>2012-07-02T17:12:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2386">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|}

== Freetype font face group group ==

This is attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>58</id>
      <timestamp>2012-07-02T17:17:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2806">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>59</id>
      <timestamp>2012-07-02T17:18:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2842">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Path to the font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>60</id>
      <timestamp>2012-07-02T17:19:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [qfont] group */</comment>
      <text xml:space="preserve" bytes="2828">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>61</id>
      <timestamp>2012-07-02T17:20:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2831">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}




== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>62</id>
      <timestamp>2012-07-02T17:23:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3113">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file, could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>63</id>
      <timestamp>2012-07-02T17:24:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3113">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>64</id>
      <timestamp>2012-07-02T17:24:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [qfont] group */</comment>
      <text xml:space="preserve" bytes="3111">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>65</id>
      <timestamp>2012-07-02T17:25:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3113">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>66</id>
      <timestamp>2012-07-02T17:26:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3115">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5%  | Key
! width=6%  | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face group.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>67</id>
      <timestamp>2012-07-02T17:30:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3213">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5%  | Key
! width=6%  | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Ascii font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|1
|''2''
|3
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>68</id>
      <timestamp>2012-07-02T17:43:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3358">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5%  | Key
! width=6%  | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|''pic'' [kern ''left'' ''right''] codes ''code1'' ''code2'' ''codeX''
|
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>69</id>
      <timestamp>2012-07-02T17:45:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3455">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5%  | Key
! width=6%  | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' [kern ''left'' ''right''] codes ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>70</id>
      <timestamp>2012-07-02T17:48:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3677">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5%  | Key
! width=6%  | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' [kern ''left'' ''right''] codes ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}


== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>120</id>
      <timestamp>2012-07-02T18:57:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[QFONT]] to [[NSX (QFont)]] without leaving a redirect: misspelled</comment>
      <text xml:space="preserve" bytes="3677">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5%  | Key
! width=6%  | Value
! width=83% | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% | Key
! width=6% | Value
! width=83% | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' [kern ''left'' ''right''] codes ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}


== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>845</id>
      <timestamp>2012-07-16T17:05:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3820">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF  | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' [kern ''left'' ''right''] codes ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}


== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>846</id>
      <timestamp>2012-07-16T17:07:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Glyph font face group */</comment>
      <text xml:space="preserve" bytes="3823">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF  | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ''ft'' - Darkplaces vector fonts using freetype library
* ''ascii'' - Quake ascii conchars (256 chars on a 16*16 table)
* ''glyph'' - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}



== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>847</id>
      <timestamp>2012-07-16T17:08:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [qfont] group */</comment>
      <text xml:space="preserve" bytes="3809">= Introduction =

.QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF  | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>994</id>
      <timestamp>2012-07-17T05:17:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3808">= Introduction =

QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF  | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|type
|''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|face
|''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|brightness
|''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|scale 
|''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|width 
|''x''
|X component of scale.
|-
|height
|''y''
|Y component of scale.
|-
|respath 
|''y''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>995</id>
      <timestamp>2012-07-17T05:19:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3813">= Introduction =

QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|file
|''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|slot
|''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|glyphs
|''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|r_antialias
|''0/1''
|Toggles antialiasing for font pages renderer.
|-
|r_hinting
|''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|r_shadow
|''strength''
|Outline shadow strength (could be more than 1).
|-
|r_shadowblur
|''strength''
|Outline shadow blur.
|-
|r_shadowofs
|''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|r_charcushion
|''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|r_charscale
|''x''
|Characters uniform scale.
|}



== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>996</id>
      <timestamp>2012-07-17T05:20:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Freetype font face group */</comment>
      <text xml:space="preserve" bytes="3835">= Introduction =

QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}

== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=5% bgcolor=#EEDFDF | Key
! width=6% bgcolor=#EEDFDF | Value
! width=83% bgcolor=#EEDFDF | Description
|-
|respath
|''path''
|Absolute path that overrides default font resources path.
|-
|glyph
|variable
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>997</id>
      <timestamp>2012-07-17T05:20:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Glyph font face group */</comment>
      <text xml:space="preserve" bytes="3819">= Introduction =

QFONT files are [[NSX|.NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}

== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>998</id>
      <timestamp>2012-07-17T05:21:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3818">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}

== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

== Glyph vs Ascii vs Freetype ==

Reason all that groups exists is that all of them was maked for different tasks. Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>999</id>
      <timestamp>2012-07-17T05:21:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3818">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}

== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}

= Glyph vs Ascii vs Freetype =

Reason all that groups exists is that all of them was maked for different tasks. 

Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1000</id>
      <timestamp>2012-07-17T05:21:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3819">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

== [qfont] group ==

Should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

== Freetype font face group ==

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}

== Glyph font face group ==

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}


= Glyph vs Ascii vs Freetype =

Reason all that groups exists is that all of them was maked for different tasks. 

Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.


[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1001</id>
      <timestamp>2012-07-17T05:23:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3840">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[qfont] should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

= Usage =
Reason all that groups exists is that all of them was maked for different tasks. 

Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1002</id>
      <timestamp>2012-07-17T05:26:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3641">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[qfont] should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* ft - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1003</id>
      <timestamp>2012-07-17T05:26:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="3641">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[qfont] should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1004</id>
      <timestamp>2012-07-17T05:28:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="3738">= Introduction =

QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[qfont] should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1005</id>
      <timestamp>2012-07-17T05:28:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3731">QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

[qfont] should be the first groups of file, it sets font drawer and face group.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1006</id>
      <timestamp>2012-07-17T05:34:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="3701">QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1007</id>
      <timestamp>2012-07-17T05:34:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3704">QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | VKey pairlue
! width=83% bgcolor=#EEDFDF | Description
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1008</id>
      <timestamp>2012-07-17T05:35:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Structure */</comment>
      <text xml:space="preserve" bytes="3703">QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

= Structure =

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1042</id>
      <timestamp>2012-07-17T20:29:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3705">QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example of .QFONT file contents:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

== Structure ==

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1046</id>
      <timestamp>2012-07-17T20:31:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3676">[[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example QFONT file:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

== Structure ==

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF  | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1102</id>
      <timestamp>2012-07-17T22:57:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3643">[[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example QFONT file:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

== Structure ==

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Key pair
! width=83% | Description
|-
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% bgcolor=#EEDFDF | Key pair
! width=83% bgcolor=#EEDFDF | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1103</id>
      <timestamp>2012-07-17T22:57:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3579">[[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.

Example QFONT file:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyphs=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

== Structure ==

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Key pair
! width=83% | Description
|-
| '''[qfont]'''
| Should be the first groups of file.
|-
|'''type'''=''x''
|Type of font drawer, each of it has it's advantages and disadvantages:

Possible values:
* FT - Darkplaces vector fonts using freetype library
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
|-
|'''face'''=''string''
|Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
|-
|'''brightness'''=''value''
|Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
|-
|'''scale'''=''x'' ''y''
|Two floating point values storing horizontal and vertical scale of font chars.
|-
|'''width'''=''x''
|X component of scale.
|-
|'''height'''=''y''
|Y component of scale.
|-
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
|}

{{hidden begin | Freetype font face group }}

Attributes of font face for freetype font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Key pair
! width=83% | Description
|-
|'''file'''=''path''
|Path to .OTF/.TTF font file. Could be relative to respath (if begins with ./) or absolute (from gamedir root).
|-
|'''slot'''=''slotname''
|Engine font slot. Used to replace fontmaps that was already initialized.

Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|Engine font slot. Used to replace fontmaps that was already initialized.

Engine will render font pages containing this string chars (others will be rendered on demand).
|-
|'''r_antialias'''=''0/1''
|Toggles antialiasing for font pages renderer.
|-
|'''r_hinting'''=''0/1/2/3''
|Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
|-
|'''r_shadow'''=''strength''
|Outline shadow strength (could be more than 1).
|-
|'''r_shadowblur'''=''strength''
|Outline shadow blur.
|-
|'''r_shadowofs'''=''x y z''
|Outline shadow offset. X and Y applied during rendering. Z is applied during blur.
|-
|'''r_charcushion'''=''x''
|Characters vertical offset in percents (1 - 100%, 0.1 - 10%).
|-
|'''r_charscale'''=''x''
|Characters uniform scale.
|}
{{hidden end}}

{{hidden begin | Glyph font face group }}

Attributes of font face for glyph font renderer.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Key pair
! width=83% | Description
|-
|'''respath'''=''path''
|Absolute path that overrides default font resources path.
|-
|'''glyph'''=''variable''
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
|}
{{hidden end}}

[[Category:File formats]]

__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>NSX (Translation string files)</title>
    <ns>0</ns>
    <id>10</id>
      <sha1>22qyb6bab3yfque1z1fmuy920fbl6vd</sha1>
    <revision>
      <id>80</id>
      <timestamp>2012-07-02T18:18:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Introduction ==  Translation strings file is [[NSX | .NSX files]] that stores string translations in the form string_id=translated_string.  Group are used as prefixes to st...&quot;</comment>
      <text xml:space="preserve" bytes="644">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that stores string translations in the form string_id=translated_string.

Group are used as prefixes to string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

defines 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;</text>
    </revision>
    <revision>
      <id>81</id>
      <timestamp>2012-07-02T18:18:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="643">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form string_id=translated_string.

Group are used as prefixes to string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

defines 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;</text>
    </revision>
    <revision>
      <id>82</id>
      <timestamp>2012-07-02T18:18:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="652">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Group are used as prefixes to string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

defines 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;</text>
    </revision>
    <revision>
      <id>83</id>
      <timestamp>2012-07-02T18:18:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="654">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

defines 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;</text>
    </revision>
    <revision>
      <id>84</id>
      <timestamp>2012-07-02T18:19:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Translation strings]] to [[Translation string files]] without leaving a redirect: misspelled</comment>
      <text xml:space="preserve" bytes="654">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

defines 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;</text>
    </revision>
    <revision>
      <id>86</id>
      <timestamp>2012-07-02T18:21:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="681">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>87</id>
      <timestamp>2012-07-02T18:21:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Translation string files]] to [[NSX (Translation string files)]] without leaving a redirect: misspelled</comment>
      <text xml:space="preserve" bytes="681">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>92</id>
      <timestamp>2012-07-02T18:24:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="746">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Groups are used as prefixes for string ids to make code shorter.

This files are only used in [[Translation | translation packs].

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>93</id>
      <timestamp>2012-07-02T18:24:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="747">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

Groups are used as prefixes for string ids to make code shorter.

This files are only used in [[Translation | translation packs]].

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>94</id>
      <timestamp>2012-07-02T18:24:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="759">== Introduction ==

Translation strings file is [[NSX | .NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

This files are only used in [[Translation | translation packs]].

'''Hint:''' Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1043</id>
      <timestamp>2012-07-17T20:30:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="758">== Introduction ==

Translation strings file is [[NSX | NSX files]] that store string translations in the form: ''string_id''=''translated_string''.

This files are only used in [[Translation | translation packs]].

'''Hint:''' Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1044</id>
      <timestamp>2012-07-17T20:30:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="709">[[NSX | NSX file]] that store string translations in the form: ''string_id''=''translated_string''.

This files are only used in [[Translation | translation packs]].

'''Hint:''' Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>2268</id>
      <timestamp>2012-07-30T20:37:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="722">[[NSX | NSX file]] that store string translations in the form: ''string_id''=''translated_string''.

This files are only used in [[Translation | translation packs]].

'''Hint:''' Groups are used as prefixes for string ids to make code shorter.

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2269</id>
      <timestamp>2012-07-30T20:37:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="718">[[NSX | NSX file]] that store string translations in the form: ''string_id''=''translated_string''.

This files are only used in [[Translation | translation packs]].

{{tip|Groups are used as prefixes for string ids to make code shorter.}}

Example:

 [''menu_option'']
 res=Resolutions
 windowed=Windowed
 bpp=Bits Per Pixel

creates 3 strings:

 menu_option_res=Resolutions
 menu_option_windowed=Windowed
 menu_option_bpp=Bits Per Pixel

Example of strings file contents:

 [''menu_btn'']
 yes         =&quot;YES&quot;
 no          =&quot;NO&quot;
 back        =&quot;BACK&quot;
 newgame     =&quot;NEW GAME&quot;
 startgame   =&quot;START GAME&quot;
 options     =&quot;OPTIONS&quot;
 loadgame    =&quot;LOAD GAME&quot;
 savegame    =&quot;SAVE GAME&quot;

[[Category:File formats]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>NetherMenu</title>
    <ns>0</ns>
    <id>8</id>
      <sha1>fwaz1zwpcpqs2bzu2wn7f7v4n2mcnwk</sha1>
    <revision>
      <id>71</id>
      <timestamp>2012-07-02T18:03:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Introduction ==  NetherMenu is QuakeC framework that covers GUI making, generic scripting and 2D draw. It's used widely in Blood Omnicide gamecode allowing for external scr...&quot;</comment>
      <text xml:space="preserve" bytes="496">== Introduction ==

NetherMenu is QuakeC framework that covers GUI making, generic scripting and 2D draw. It's used widely in Blood Omnicide gamecode allowing for external scripting of game aspects.

== Modules ==

''NetherScript 2.0'' - extendable text files parser with support of precompiler (#define, #ifdef, #include etc.).

''NetherCode'' - extendable script language for making mathematical expressions and dynamic code.

''NetherConfig'' - INI-like files parser (see [[.NSX files | NSX]])</text>
    </revision>
    <revision>
      <id>77</id>
      <timestamp>2012-07-02T18:10:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Modules */</comment>
      <text xml:space="preserve" bytes="496">== Introduction ==

NetherMenu is QuakeC framework that covers GUI making, generic scripting and 2D draw. It's used widely in Blood Omnicide gamecode allowing for external scripting of game aspects.

== Modules ==

''NetherScript 2.0'' - extendable text files parser with support of precompiler (#define, #ifdef, #include etc.).

''NetherCode'' - extendable script language for making mathematical expressions and dynamic code.

''NetherConfig'' - INI-like files parser (see [[NSX | .NSX files]])</text>
    </revision>
    <revision>
      <id>990</id>
      <timestamp>2012-07-17T05:15:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="519">== Introduction ==

NetherMenu is QuakeC framework that covers GUI making, generic scripting and 2D draw. It's used widely in Blood Omnicide gamecode allowing for external scripting of game aspects.

== Modules ==

''NetherScript 2.0'' - extendable text files parser with support of precompiler (#define, #ifdef, #include etc.).

''NetherCode'' - extendable script language for making mathematical expressions and dynamic code.

''NetherConfig'' - INI-like files parser (see [[NSX | .NSX files]])

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>991</id>
      <timestamp>2012-07-17T05:16:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="528">== Introduction ==

NetherMenu is QuakeC framework that covers GUI making, generic scripting and 2D draw. It's used widely in Blood Omnicide gamecode allowing for external scripting of game aspects.

== Modules ==

''NetherScript 2.0'' - extendable text files parser with support of precompiler (#define, #ifdef, #include etc.).

''NetherCode'' - extendable script language for making mathematical expressions and dynamic code.

''NetherConfig'' - INI-like files parser

== See also ==
* [[NSX]]
* [[NS2]]

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>Normal smoothing</title>
    <ns>0</ns>
    <id>274</id>
      <sha1>n9moj0at2gzy543w15xt82ddux15t69</sha1>
    <revision>
      <id>2674</id>
      <timestamp>2012-09-25T18:35:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}} [[File:Normalsmoothing.jpg|right|thumb|350px]] Normal smoothing is the form of automatic smoothing. It averages normals of coincident vertexes between brush fac...&quot;</comment>
      <text xml:space="preserve" bytes="649">{{unfinished}}
[[File:Normalsmoothing.jpg|right|thumb|350px]]
Normal smoothing is the form of automatic smoothing. It averages normals of coincident vertexes between brush faces (or model triangles) whose angle is greater than 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (BSP phase only). A valid break angle is from 1 to 179 degrees.

{{important|Normal smoothing only works with metasurface pipeline. So BSP -meta key is required.}}

Since normal smoothing affects vertex data, it works both for lightmaps and realtime lighting.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2675</id>
      <timestamp>2012-09-25T18:35:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="651">{{unfinished}}
[[File:Normalsmoothing.jpg|right|thumb|350px]]
Normal smoothing is the form of automatic smoothing. It averages normals of coincident vertexes between brush faces (or model triangles) whose angle is greater than 'break' angle. 

Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (BSP phase only). A valid break angle is from 1 to 179 degrees.

{{important|Normal smoothing only works with metasurface pipeline. So BSP -meta key is required.}}

Since normal smoothing affects vertex data, it works both for lightmaps and realtime lighting.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2676</id>
      <timestamp>2012-09-25T18:40:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="757">{{unfinished}}
[[File:Normalsmoothing.jpg|right|thumb|350px]]
Normal smoothing is the form of automatic smoothing. It averages normals of coincident vertexes between brush faces (or model triangles) whose angle is greater than 'break' angle. 

Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (BSP phase only). A valid break angle is from 1 to 179 degrees.

{{important|Normal smoothing only works with metasurface pipeline. So BSP -meta key is required.}}

Since normal smoothing affects vertex data, it works both for LIGHT phase and realtime lighting.

{{bug|Normal smoothing may break [[parallax mapping]] since it uses vertex normals for displacement.}}

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2677</id>
      <timestamp>2012-09-25T18:40:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="757">{{unfinished}}
[[File:Normalsmoothing.jpg|right|thumb|350px]]
Normal smoothing is the form of automatic smoothing. It averages normals of coincident vertexes between brush faces (or model triangles) whose angle is greater than 'break' angle. 

Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (BSP phase only). A valid break angle is from 1 to 179 degrees.

Since normal smoothing affects vertex data, it works both for LIGHT phase and realtime lighting.

{{important|Normal smoothing only works with metasurface pipeline. So BSP -meta key is required.}}

{{bug|Normal smoothing may break [[parallax mapping]] since it uses vertex normals for displacement.}}

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>Normalmap</title>
    <ns>0</ns>
    <id>119</id>
      <sha1>mwdqinjreaw2ialuirsyqq8v41k70id</sha1>
    <revision>
      <id>1237</id>
      <timestamp>2012-07-18T11:38:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without addin more poly...&quot;</comment>
      <text xml:space="preserve" bytes="622">Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without addin more polygons. Therefor, normalmaps havfe a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps can additionally store alpha-component which represents height that will be use for [[parallex mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1240</id>
      <timestamp>2012-07-18T11:46:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="821">[[File:Normalmap bowl.jpg|200px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|200px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are OpenGL-oriented (X stores horizontal, Y vertical) and can additionally store alpha-component which represents height that will be use for [[parallex mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1241</id>
      <timestamp>2012-07-18T11:46:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="835">[[File:Normalmap bowl.jpg|200px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|200px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are tangentspace, OpenGL-oriented (X stores horizontal, Y vertical) and can additionally store alpha-component which represents height that will be use for [[parallex mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1242</id>
      <timestamp>2012-07-18T11:50:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="841">[[File:Normalmap bowl.jpg|200px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|200px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangentspace RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Can additionally store alpha-component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1243</id>
      <timestamp>2012-07-18T11:51:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="840">[[File:Normalmap bowl.jpg|200px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|200px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1244</id>
      <timestamp>2012-07-18T11:52:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="840">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1245</id>
      <timestamp>2012-07-18T11:54:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="851">{|
|[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
|- 
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]
|}

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1246</id>
      <timestamp>2012-07-18T11:55:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="862">{ width=300 |
|[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
|- 
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]
|}

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1247</id>
      <timestamp>2012-07-18T11:55:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="861">{| width=300
|[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
|- 
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]
|}

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1248</id>
      <timestamp>2012-07-18T11:56:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="863">{| align=right
|[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
|- 
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]
|}

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1249</id>
      <timestamp>2012-07-18T11:56:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="874">&lt;div style=&quot;float:right&quot;&gt;
[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
&lt;/div&gt;
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]


Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1250</id>
      <timestamp>2012-07-18T11:56:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="873">&lt;div style=&quot;float:left&quot;&gt;
[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
&lt;/div&gt;
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]


Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1251</id>
      <timestamp>2012-07-18T11:56:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="840">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1252</id>
      <timestamp>2012-07-18T11:57:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="884">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surfaces normals directly in the RGB values of an image. They can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1253</id>
      <timestamp>2012-07-18T12:08:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1182">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* Normalmappers have a couple of quirks (aliasing, noise).
* Seams and hard edges is tricky.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1254</id>
      <timestamp>2012-07-18T12:09:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1256">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* Normalmappers have a couple of quirks (aliasing, noise).
* UV seams and vertex normals 'hard edges' is tricky.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1255</id>
      <timestamp>2012-07-18T12:09:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1258">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. 

Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* Normalmappers have a couple of quirks (aliasing, noise).
* UV seams and vertex normals 'hard edges' is tricky.

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1256</id>
      <timestamp>2012-07-18T12:12:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1270">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. 

Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* UV seams and 'hard edges' produces by vertex normals is tricky.
* Normalmappers have a couple of quirks (aliasing, noise).

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces Engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1257</id>
      <timestamp>2012-07-18T12:12:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1270">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. 

Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* UV seams and 'hard edges' produces by vertex normals is tricky.
* Normalmappers have a couple of quirks (aliasing, noise).

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be use for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1258</id>
      <timestamp>2012-07-18T12:12:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1271">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. 

Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* UV seams and 'hard edges' produces by vertex normals is tricky.
* Normalmappers have a couple of quirks (aliasing, noise).

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be used for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]</text>
    </revision>
    <revision>
      <id>1259</id>
      <timestamp>2012-07-18T12:55:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1294">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. 

Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* UV seams and 'hard edges' produced by vertex normals is tricky.
* Normalmappers have a couple of quirks (aliasing, noise).

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be used for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2294</id>
      <timestamp>2012-07-30T21:47:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1307">[[File:Normalmap bowl.jpg|150px|thumb|Normalmap for a bowl model]]
[[File:Heightmap_tiles.jpg|150px|thumb|Heightmap for parallax mapping]]

Normal maps are images that store per-pixel surface normals directly in the RGB values of an image. Properly done normalmaps can dramatically increase object detalisation without adding more polygons. 

Therefore, normalmaps have a bunch fo limits and quirks:

* Tangentspace normalmap is based on vertex normals, if vertex normals is adjusted, normalmap is outdated.
* There is DirectX and OpenGL normalmap format, should figure out what format tool is producing and fix normalmap if it doesnt fit.
* UV seams and 'hard edges' produced by vertex normals is tricky.
* Normalmappers have a couple of quirks (aliasing, noise).

'''Recommended articles on normalmaps:'''
* [http://wiki.polycount.com/NormalMap/ Polycount Wiki]
* [http://www.svartberg.com/tutorials/article_normalmaps/normalmaps.html Normalmaps for the Technical Game Modeler]

In Darkplaces engine, normalmaps are:
* Tangent-space RGB
* OpenGL-oriented (X stores horizontal, Y vertical)
* Optionally can store alpha component which represents height that will be used for [[parallax mapping]].
* Compressed to DXT1 (if not alpha) or DXT5

== See also ==
* [[Texture]]

[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>OmniEditor reference</title>
    <ns>0</ns>
    <id>661</id>
      <sha1>839tt7qv6vdc372j7o4xqj84xs3ndp6</sha1>
    <revision>
      <id>3672</id>
      <timestamp>2013-10-02T06:33:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.  == Chapters == &lt;font size=3&gt; #[[DpEditor Reference/Introduction|Intr...&quot;</comment>
      <text xml:space="preserve" bytes="601">DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.

== Chapters ==
&lt;font size=3&gt;
#[[DpEditor Reference/Introduction|Introduction]]
#[[DpEditor Reference/Lights Editor|Lights Editor]]
#[[DpEditor Reference/Model Viewer|Model Viewer]]
#[[DpEditor Reference/Decorator|Decorator]]
#[[DpEditor Reference/PhysBox|PhysBox]]
#[[DpEditor Reference/Particle Editor|Particle Editor]]
#[[DpEditor Reference/Entity Editor|Entity Editor]]
#[[DpEditor Reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]
{{wip}}</text>
    </revision>
    <revision>
      <id>3673</id>
      <timestamp>2013-10-02T06:33:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="601">DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.

== Chapters ==
&lt;font size=3&gt;
#[[DpEditor Reference/Introduction|Introduction]]
#[[DpEditor Reference/Lights Editor|Lights Editor]]
#[[DpEditor Reference/Model Viewer|Model Viewer]]
#[[DpEditor Reference/Decorator|Decorator]]
#[[DpEditor Reference/PhysBox|PhysBox]]
#[[DpEditor Reference/Particle Editor|Particle Editor]]
#[[DpEditor Reference/Entity Editor|Entity Editor]]
#[[DpEditor Reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]
{{WIP}}</text>
    </revision>
    <revision>
      <id>3674</id>
      <timestamp>2013-10-02T06:33:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="601">{{WIP}}
DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.

== Chapters ==
&lt;font size=3&gt;
#[[DpEditor Reference/Introduction|Introduction]]
#[[DpEditor Reference/Lights Editor|Lights Editor]]
#[[DpEditor Reference/Model Viewer|Model Viewer]]
#[[DpEditor Reference/Decorator|Decorator]]
#[[DpEditor Reference/PhysBox|PhysBox]]
#[[DpEditor Reference/Particle Editor|Particle Editor]]
#[[DpEditor Reference/Entity Editor|Entity Editor]]
#[[DpEditor Reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>3676</id>
      <timestamp>2013-10-02T11:36:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[DpEditor Reference]] to [[OmniEditor Reference]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="601">{{WIP}}
DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.

== Chapters ==
&lt;font size=3&gt;
#[[DpEditor Reference/Introduction|Introduction]]
#[[DpEditor Reference/Lights Editor|Lights Editor]]
#[[DpEditor Reference/Model Viewer|Model Viewer]]
#[[DpEditor Reference/Decorator|Decorator]]
#[[DpEditor Reference/PhysBox|PhysBox]]
#[[DpEditor Reference/Particle Editor|Particle Editor]]
#[[DpEditor Reference/Entity Editor|Entity Editor]]
#[[DpEditor Reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>3678</id>
      <timestamp>2013-10-02T11:37:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[OmniEditor Reference]] to [[OmniEditor reference]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="601">{{WIP}}
DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.

== Chapters ==
&lt;font size=3&gt;
#[[DpEditor Reference/Introduction|Introduction]]
#[[DpEditor Reference/Lights Editor|Lights Editor]]
#[[DpEditor Reference/Model Viewer|Model Viewer]]
#[[DpEditor Reference/Decorator|Decorator]]
#[[DpEditor Reference/PhysBox|PhysBox]]
#[[DpEditor Reference/Particle Editor|Particle Editor]]
#[[DpEditor Reference/Entity Editor|Entity Editor]]
#[[DpEditor Reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>3679</id>
      <timestamp>2013-10-02T11:38:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="617">{{WIP}}
DpEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.

== Chapters ==
&lt;font size=3&gt;
#[[OmniEditor reference/Introduction|Introduction]]
#[[OmniEditor reference/Lights Editor|Lights Editor]]
#[[OmniEditor reference/Model Viewer|Model Viewer]]
#[[OmniEditor reference/Decorator|Decorator]]
#[[OmniEditor reference/PhysBox|PhysBox]]
#[[OmniEditor reference/Particle Editor|Particle Editor]]
#[[OmniEditor reference/Entity Editor|Entity Editor]]
#[[OmniEditor reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>3685</id>
      <timestamp>2013-10-02T15:30:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="689">[[File:Omnieditor1.jpg|thumb|512px|right|OmniEditor Particle Editor module]]
OmniEditor is as ingame editor that combines several tools to assist game development on Darkplaces engine.


== Chapters ==
&lt;font size=3&gt;
#[[OmniEditor reference/Introduction|Introduction]]
#[[OmniEditor reference/Lights Editor|Lights Editor]]
#[[OmniEditor reference/Model Viewer|Model Viewer]]
#[[OmniEditor reference/Decorator|Decorator]]
#[[OmniEditor reference/PhysBox|PhysBox]]
#[[OmniEditor reference/Particle Editor|Particle Editor]]
#[[OmniEditor reference/Entity Editor|Entity Editor]]
#[[OmniEditor reference/Environments Editor|Environments Editor]]
&lt;/font&gt;

__NOTOC__
[[Category:Darkplaces engine]]</text>
    </revision>
  </page>
  <page>
    <title>OmniEditor reference/Introduction</title>
    <ns>0</ns>
    <id>663</id>
      <sha1>rjtirencp8yhwkgw6dy61ca36g511u7</sha1>
    <revision>
      <id>3681</id>
      <timestamp>2013-10-02T12:29:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|}} When working with a game mode, you always face the task of previewing something in game. Historically, Darkplaces engine have no [[WYSIWYG]] philosophy e...&quot;</comment>
      <text xml:space="preserve" bytes="3357">{{navigation title|}}
When working with a game mode, you always face the task of previewing something in game. Historically, Darkplaces engine have no [[WYSIWYG]] philosophy embedded on it's heart. Map, models, materials and other components of a game are made in separate standalone tools, and you eventually need to test them. If you are texturing model, you need to place it in game work and check how it looks compared to the rest of the game. When writing materials you need to know if material script are correct. When making a level, you need to fly around map and inspect level parts being made. OmniEditor give you a convenient way to do this, providing a bits of WYSIWYG way. Being a set of ingame tools united together with a simple GUI, OmniEditor functionality can be expanded by introducing new modules. 

The generic purpose of OmniEditor is:

* Inspect game environments
* Edit specific game aspects
* Test stuff

This includes model preview, screenshots making, constructing particle effects, placing dynamic lights, decorative models, specific entities and so on.
==Launching editor==
To launch editor, type 'omniedit' on keyboard or in [[console]] during a game. Of couse, some level should be loaded before you can start. Once loading finishes, the brown menu will appear on the right of the screen. To prevent Main menu will show available modules to use. By default omniedit loads up all available modules. Additionally each module have a keyhook for single launch (for faster loading).
{{cmd|map x|Load specific game level}}
{{cmd|omniedit|Launch OmniEditor}}
{{important|OmniEditor is only meant to be launched with developer version of the engine (developer checkbox in launcher settings). When launched with stock engine build, it can cause a crash because of game build limits.}}
{{tip|to prevent Kain from being drained out of blood, editor launches 'give all' cheat once started}}
==File system==
OmniEditor works inside the game, so it is using engine [[Darkplaces virtual file system|Virtual File System]]. Therefore it cannot open files outside of game directory, or write game files outside of gamedir/data folder.

Before using some content with OmniEditor tools, be sure to have them inside gamedir (for Blood Omnicide gamedir is ''Path_To_The_Game/kain/'').

You can add new files withour restarting the editor.
==Camera==
Editor camera works in 2 modes: the freecam mode and fixed mode. 
* In free cam mode, camera fly around level using EDFS buttons. Mouse are used to rotate view, crosshair are used to select objects. This mode is aimed to 'fly and check' editing style, which most of tools are aimed for.
* In fixed mode, camera only moves around its up and right axis. Camera look direction are fixed (like in real time strategy game), mouse pointer are used to select objects. This mode is used primarily by decorator module.
==Updating the game files==
If some of game files were updated during editing session (you have compiled a map, replaced some of the game textures etc. You should force editor to restart using console commands:
{{cmd|r_restart|Restarts the renderer, reloads all textures, models, materials and other render-related files (included the .bsp file).}}
{{cmd|restart|Restarts level. Makes game to re-parse loaded BSP and launch level again.}} 
{{navigation footer|Lights Editor}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3682</id>
      <timestamp>2013-10-02T12:57:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="4369">{{navigation title|}}
When working with a game mode, you always face the task of previewing something in game. Historically, Darkplaces engine have no [[WYSIWYG]] philosophy embedded on it's heart. Map, models, materials and other components of a game are made in separate standalone tools, and you eventually need to test them. If you are texturing model, you need to place it in game work and check how it looks compared to the rest of the game. When writing materials you need to know if material script are correct. When making a level, you need to fly around map and inspect level parts being made. OmniEditor give you a convenient way to do this, providing a bits of WYSIWYG way. Being a set of ingame tools united together with a simple GUI, OmniEditor functionality can be expanded by introducing new modules. 

The generic purpose of OmniEditor is:

* Inspect game environments
* Edit specific game aspects
* Test stuff

This includes model preview, screenshots making, constructing particle effects, placing dynamic lights, decorative models, specific entities and so on.
==Launching editor==
To launch editor, type 'omniedit' on keyboard or in [[console]] during a game. Of couse, some level should be loaded before you can start. Once loading finishes, the brown menu will appear on the right of the screen. To prevent Main menu will show available modules to use. By default omniedit loads up all available modules. Additionally each module have a keyhook for single launch (for faster loading).
{{cmd|map x|Load specific game level}}
{{cmd|omniedit|Launch OmniEditor}}
{{important|OmniEditor is only meant to be launched with developer version of the engine (developer checkbox in launcher settings). When launched with stock engine build, it can cause a crash because of game build limits.}}
{{tip|to prevent Kain from being drained out of blood, editor launches 'give all' cheat once started}}
==File system==
OmniEditor works inside the game, so it is using engine [[Darkplaces virtual file system|Virtual File System]]. Therefore it cannot open files outside of game directory, or write game files outside of gamedir/data folder.

Before using some content with OmniEditor tools, be sure to have them inside gamedir (for Blood Omnicide gamedir is ''Path_To_The_Game/kain/'').

You can add new files withour restarting the editor.
==Modular system==
Editor module - a separate tool created to conver some of the editing work flow. Each module have a specific tools and action assigned, this tool actions only can be performed if module is active. There can be only one active module.
==Camera==
Editor camera works in 2 modes: the freecam mode and fixed mode. 
* In free cam mode, camera fly around level using EDFS buttons. Mouse are used to rotate view, crosshair are used to select objects. This mode is aimed to 'fly and check' editing style, which most of tools are aimed for.
* In fixed mode, camera only moves around its up and right axis. Camera look direction are fixed (like in real time strategy game), mouse pointer are used to select objects. This mode is used primarily by decorator module.
==Updating the game files==
If some of game files were updated during editing session (you have compiled a map, replaced some of the game textures etc. You should force editor to restart using console commands:
{{cmd|r_restart|Restarts the renderer, reloads all textures, models, materials and other render-related files (included the .bsp file).}}
{{cmd|restart|Restarts level. Makes game to re-parse loaded BSP and launch level again.}} 
==Hotkeys==
The editor work flow is heavily based on hotkey usage. Here is the generic hotkeys:
* SHIFT+ESC - bring the game console
* TAB - show/hide sidemenu
* ESCAPE - move the the previous menu (beware the Photoshop blocking ESC button in other apps glitch).
* Mouse click - activate the selected menu
* Mouse wheel - select next or previous menu item
* SHIFT+F - togglex free/fixed camera mode.
* ALT+SHIFT+''number'' - go to the some loaded module.
Most of specific module action (such as placing the light, or removing selected item) have its own special hotkey which activates with the module. This 'global' hotekeys are gold-colored. The are also menu button hotkeys which are only active if their menu page is shown, these hotkeys are gray-colored.
{{navigation footer|Lights Editor}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3683</id>
      <timestamp>2013-10-02T12:58:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Hotkeys */</comment>
      <text xml:space="preserve" bytes="4370">{{navigation title|}}
When working with a game mode, you always face the task of previewing something in game. Historically, Darkplaces engine have no [[WYSIWYG]] philosophy embedded on it's heart. Map, models, materials and other components of a game are made in separate standalone tools, and you eventually need to test them. If you are texturing model, you need to place it in game work and check how it looks compared to the rest of the game. When writing materials you need to know if material script are correct. When making a level, you need to fly around map and inspect level parts being made. OmniEditor give you a convenient way to do this, providing a bits of WYSIWYG way. Being a set of ingame tools united together with a simple GUI, OmniEditor functionality can be expanded by introducing new modules. 

The generic purpose of OmniEditor is:

* Inspect game environments
* Edit specific game aspects
* Test stuff

This includes model preview, screenshots making, constructing particle effects, placing dynamic lights, decorative models, specific entities and so on.
==Launching editor==
To launch editor, type 'omniedit' on keyboard or in [[console]] during a game. Of couse, some level should be loaded before you can start. Once loading finishes, the brown menu will appear on the right of the screen. To prevent Main menu will show available modules to use. By default omniedit loads up all available modules. Additionally each module have a keyhook for single launch (for faster loading).
{{cmd|map x|Load specific game level}}
{{cmd|omniedit|Launch OmniEditor}}
{{important|OmniEditor is only meant to be launched with developer version of the engine (developer checkbox in launcher settings). When launched with stock engine build, it can cause a crash because of game build limits.}}
{{tip|to prevent Kain from being drained out of blood, editor launches 'give all' cheat once started}}
==File system==
OmniEditor works inside the game, so it is using engine [[Darkplaces virtual file system|Virtual File System]]. Therefore it cannot open files outside of game directory, or write game files outside of gamedir/data folder.

Before using some content with OmniEditor tools, be sure to have them inside gamedir (for Blood Omnicide gamedir is ''Path_To_The_Game/kain/'').

You can add new files withour restarting the editor.
==Modular system==
Editor module - a separate tool created to conver some of the editing work flow. Each module have a specific tools and action assigned, this tool actions only can be performed if module is active. There can be only one active module.
==Camera==
Editor camera works in 2 modes: the freecam mode and fixed mode. 
* In free cam mode, camera fly around level using EDFS buttons. Mouse are used to rotate view, crosshair are used to select objects. This mode is aimed to 'fly and check' editing style, which most of tools are aimed for.
* In fixed mode, camera only moves around its up and right axis. Camera look direction are fixed (like in real time strategy game), mouse pointer are used to select objects. This mode is used primarily by decorator module.
==Updating the game files==
If some of game files were updated during editing session (you have compiled a map, replaced some of the game textures etc. You should force editor to restart using console commands:
{{cmd|r_restart|Restarts the renderer, reloads all textures, models, materials and other render-related files (included the .bsp file).}}
{{cmd|restart|Restarts level. Makes game to re-parse loaded BSP and launch level again.}} 
==Hotkeys==
The editor work flow is heavily based on hotkey usage. Here is the generic hotkeys:
* SHIFT+ESC - bring the game console
* TAB - show/hide sidemenu
* ESCAPE - move the the previous menu (beware the Photoshop blocking ESC button in other apps glitch).
* Mouse click - activate the selected menu
* Mouse wheel - select next or previous menu item
* SHIFT+F - togglex free/fixed camera mode.
* ALT+SHIFT+''number'' - go to the some loaded module.
Most of specific module action (such as placing the light, or removing selected item) have its own special hotkey which activates with the module. This 'global' hotekeys are gold-colored.

The are also menu button hotkeys which are only active if their menu page is shown, these hotkeys are gray-colored.
{{navigation footer|Lights Editor}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>PAK</title>
    <ns>0</ns>
    <id>123</id>
      <sha1>7lklrdg4q7kktlzldc7cecjbsahw1rs</sha1>
    <revision>
      <id>1322</id>
      <timestamp>2012-07-20T10:51:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Game arhive format used in Quake. Since [[PK3]] is there, PAK are obsolete.  [[Category:Glossary]]&quot;</comment>
      <text xml:space="preserve" bytes="98">Game arhive format used in Quake. Since [[PK3]] is there, PAK are obsolete.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1323</id>
      <timestamp>2012-07-20T10:52:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="102">Game arhive format used in Quake. Since [[PK3]] is there, PAK are obsolete.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1331</id>
      <timestamp>2012-07-20T11:01:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="133">Game arhive format used in Quake. Since [[PK3]] is there, PAK are obsolete.

[[Category:File formats]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2293</id>
      <timestamp>2012-07-30T21:47:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="146">Game arhive format used in Quake. Since [[PK3]] is there, PAK are obsolete.

[[Category:File formats]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>PK3</title>
    <ns>0</ns>
    <id>2</id>
      <sha1>8rlo1rsbf85ou7h0wmm2bs8fd1udgto</sha1>
    <revision>
      <id>14</id>
      <timestamp>2012-07-02T13:03:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;PK3 file is a renamed ZIP file, used in Id Tech 3-powered games. PK3 is supported by Darkplaces Engine and therefore used by Blood Omnicide.  PK3 files usually can be viewed, ...&quot;</comment>
      <text xml:space="preserve" bytes="246">PK3 file is a renamed ZIP file, used in Id Tech 3-powered games. PK3 is supported by Darkplaces Engine and therefore used by Blood Omnicide.

PK3 files usually can be viewed, extracted and created using ZIP archive tools, such as 7Zip and WinRar.</text>
    </revision>
    <revision>
      <id>15</id>
      <timestamp>2012-07-02T13:04:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="249">PK3 file is a renamed ZIP file, used in Id Tech 3 - powered games.

PK3 is supported by Darkplaces Engine and therefore used by Blood Omnicide.

PK3 files usually can be viewed, extracted and created using ZIP archive tools, such as 7Zip and WinRar.</text>
    </revision>
    <revision>
      <id>30</id>
      <timestamp>2012-07-02T13:46:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="276">PK3 file is a renamed ZIP file, used in Id Tech 3 - powered games.

PK3 is supported by Darkplaces Engine and therefore used by Blood Omnicide.

PK3 files usually can be viewed, extracted and created using ZIP archive tools, such as 7Zip and WinRar.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1048</id>
      <timestamp>2012-07-17T20:33:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="186">Renamed ZIP file used in Id Tech 3-powered games and Darkplaces engine.

Can be created, viewed and extracted using ZIP archive tools, such as 7Zip and WinRar.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1332</id>
      <timestamp>2012-07-20T11:01:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="217">Renamed ZIP file used in Id Tech 3-powered games and Darkplaces engine.

Can be created, viewed and extracted using ZIP archive tools, such as 7Zip and WinRar.

[[Category:File formats]]
[[Category:Darkplaces engine]]</text>
    </revision>
  </page>
  <page>
    <title>PVS</title>
    <ns>0</ns>
    <id>127</id>
      <sha1>ipdz5ucah6pk9bh0v6nk9v3nw7szu7q</sha1>
    <revision>
      <id>1396</id>
      <timestamp>2012-07-22T18:16:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.  PVS is using precomputated vis...&quot;</comment>
      <text xml:space="preserve" bytes="440">Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.

PVS is using precomputated visibility data that is calculated at the VIS stage of map compilation.

== Console variables ==

r_lockpvs : disables PVS switching so you can walk around and inspect what is visible from locked position (anything not in PVS will not be drawn).

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2022</id>
      <timestamp>2012-07-27T14:33:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="446">Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.

PVS is using precomputated visibility data that is calculated at the VIS stage of map compilation.

== Console variables ==
{{cvar|r_lockpvs|disables PVS switching so you can walk around and inspect what is visible from locked position (anything not in PVS will not be drawn).}}

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2023</id>
      <timestamp>2012-07-27T14:33:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="450">Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.

PVS is using precomputated visibility data that is calculated at the VIS stage of [[map compilation]].

== Console variables ==
{{cvar|r_lockpvs|disables PVS switching so you can walk around and inspect what is visible from locked position (anything not in PVS will not be drawn).}}

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2279</id>
      <timestamp>2012-07-30T20:42:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="463">Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.

PVS is using precomputated visibility data that is calculated at the VIS stage of [[map compilation]].

== Console variables ==
{{cvar|r_lockpvs|disables PVS switching so you can walk around and inspect what is visible from locked position (anything not in PVS will not be drawn).}}

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2565</id>
      <timestamp>2012-08-09T14:54:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="487">Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.

PVS is using precomputated visibility data that is calculated at the VIS stage of [[map compilation]].

== Console variables ==
{{cvar|r_lockpvs|disables PVS switching so you can walk around and inspect what is visible from locked position (anything not in PVS will not be drawn).}}

==See also==
* [[VIS]]

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2648</id>
      <timestamp>2012-09-03T06:05:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="550">Potentially Viewable Set - a technique for culling used on server and client to exclude entities that are not seen from a position of a player.

PVS is using precomputated visibility data that is calculated at the VIS stage of [[map compilation]].

== Console variables ==
{{cvar|r_lockpvs|disables PVS switching so you can walk around and inspect what is visible from locked position (anything not in PVS will not be drawn).}}
{{cvar|sv_cullentities_pvs|Enables PVS culling for entities.}}

==See also==
* [[VIS]]

[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Pattern script</title>
    <ns>0</ns>
    <id>20</id>
      <sha1>9fmyjo0kiwxuqd0nzbojj38zn2gd8ie</sha1>
    <revision>
      <id>199</id>
      <timestamp>2012-07-02T23:16:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;= Introduction = Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.  Pattern...&quot;</comment>
      <text xml:space="preserve" bytes="467">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{|
! Operator
! Description
|-
| ( ''expression'' ) 
| Expression
|-
| &amp; 
| Logic 'And'
|-
| |
| Logic 'Or'
|-
| &gt;
| Bigger
|-
| &lt; 
| Lesser
|}</text>
    </revision>
    <revision>
      <id>200</id>
      <timestamp>2012-07-02T23:17:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="538">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot;
! Operator
! Description
|-
| ( ''expression'' ) 
| Expression
|-
| &amp; 
| Logic 'And'
|-
| |
| Logic 'Or'
|-
| &gt;
| Bigger
|-
| &lt; 
| Lesser
|}</text>
    </revision>
    <revision>
      <id>201</id>
      <timestamp>2012-07-02T23:18:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="621">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=60%
! width=15% | Operator
! width=25% | Description
! width=15% | Operator
! width=25% | Description
|-
| ( ''expression'' ) 
| Expression
|-
| &amp; 
| Logic 'And'
|-
| |
| Logic 'Or'
|-
| &gt;
| Bigger
|-
| &lt; 
| Lesser
|}</text>
    </revision>
    <revision>
      <id>202</id>
      <timestamp>2012-07-02T23:18:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="667">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=60%
! width=5% | Operator
! width=10% | Description
! width=5% | Operator
! width=10% | Description
! width=5% | Operator
! width=10% | Description
|-
| ( ''expression'' ) 
| Expression
|-
| &amp; 
| Logic 'And'
|-
| |
| Logic 'Or'
|-
| &gt;
| Bigger
|-
| &lt; 
| Lesser
|}</text>
    </revision>
    <revision>
      <id>203</id>
      <timestamp>2012-07-02T23:19:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="668">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=5% | Operator
! width=10% | Description
! width=5% | Operator
! width=10% | Description
! width=5% | Operator
! width=10% | Description
|-
| ( ''expression'' ) 
| Expression
|-
| &amp; 
| Logic 'And'
|-
| |
| Logic 'Or'
|-
| &gt;
| Bigger
|-
| &lt; 
| Lesser
|}</text>
    </revision>
    <revision>
      <id>204</id>
      <timestamp>2012-07-02T23:23:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="893">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
|-
| 1
| '''(''' ''expression'' ''')''' 
| Expression
| 6
| &gt;
| Greater
|-
| 2
| '''&amp;'''
| Logic 'And'
| 7
| &gt;=
| Greater or equal
|-
| 3
| '''|'''
| Logic 'Or'
| 8
| &lt;
| Lesser
|-
| 4
| '''='''
| Equal
| 9
| &lt;=
| Lesser or equal
|-
| 5
| '''!=''' 
| Not equal
| 10
| '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>205</id>
      <timestamp>2012-07-02T23:23:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="894">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
|-
| 1
| '''(''' ''expression'' ''')''' 
| Expression
| 6
| &gt;
| Greater
|-
| 2
| '''&amp;'''
| Logic 'And'
| 7
| &gt;=
| Greater or equal
|-
| 3
| '''\|'''
| Logic 'Or'
| 8
| &lt;
| Lesser
|-
| 4
| '''='''
| Equal
| 9
| &lt;=
| Lesser or equal
|-
| 5
| '''!=''' 
| Not equal
| 10
| '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>206</id>
      <timestamp>2012-07-02T23:23:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="907">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
|-
| 1
| '''(''' ''expression'' ''')''' 
| Expression
| 6
| '''&gt;'''
| Greater
|-
| 2
| '''&amp;'''
| Logic 'And'
| 7
| '''&gt;='''
| Greater or equal
|-
| 3
| '''|'''
| Logical 'Or'
| 8
| &lt;
| Lesser
|-
| 4
| '''='''
| Equal
| 9
| &lt;=
| Lesser or equal
|-
| 5
| '''!=''' 
| Not equal
| 10
| '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>207</id>
      <timestamp>2012-07-02T23:24:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="919">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
! width=1% | #
! width=5% | Operator
! width=10% | Description
|-
| 1
| '''(''' ''expression'' ''')''' 
| Expression
| 6
| '''&gt;'''
| Greater
|-
| 2
| '''&amp;'''
| Logic 'And'
| 7
| '''&gt;='''
| Greater or equal
|-
| 3
| '''|'''
| Logical 'Or'
| 8
| '''&lt;'''
| Lesser
|-
| 4
| '''='''
| Equal
| 9
| '''&lt;='''
| Lesser or equal
|-
| 5
| '''!=''' 
| Not equal
| 10
| '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>208</id>
      <timestamp>2012-07-02T23:24:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="919">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1% | #
! width=3% | Operator
! width=10% | Description
! width=1% | #
! width=3% | Operator
! width=10% | Description
! width=1% | #
! width=3% | Operator
! width=10% | Description
|-
| 1
| '''(''' ''expression'' ''')''' 
| Expression
| 6
| '''&gt;'''
| Greater
|-
| 2
| '''&amp;'''
| Logic 'And'
| 7
| '''&gt;='''
| Greater or equal
|-
| 3
| '''|'''
| Logical 'Or'
| 8
| '''&lt;'''
| Lesser
|-
| 4
| '''='''
| Equal
| 9
| '''&lt;='''
| Lesser or equal
|-
| 5
| '''!=''' 
| Not equal
| 10
| '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>209</id>
      <timestamp>2012-07-02T23:25:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="1075">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=10% | Description
! width=1%  | #
! width=3%  | Operator
! width=10% | Description
! width=1%  | #
! width=3%  | Operator
! width=10% | Description
|-
| align=center | 1
| '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| '''&gt;'''
| Greater
|-
| align=center | 2
| '''&amp;'''
| Logic 'And'
| align=center | 7
| '''&gt;='''
| Greater or equal
|-
| align=center | 3
| '''|'''
| Logical 'Or'
| align=center | 8
| '''&lt;'''
| Lesser
|-
| align=center | 4
| '''='''
| Equal
| align=center | 9
| '''&lt;='''
| Lesser or equal
|-
| align=center | 5
| '''!=''' 
| Not equal
| align=center | 10
| '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>210</id>
      <timestamp>2012-07-02T23:25:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="1225">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=10% | Description
! width=1%  | #
! width=3%  | Operator
! width=10% | Description
! width=1%  | #
! width=3%  | Operator
! width=10% | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''&gt;'''
| Greater
|-
| align=center | 2
| align=center | '''&amp;'''
| Logic 'And'
| align=center | 7
| align=center | '''&gt;='''
| Greater or equal
|-
| align=center | 3
| align=center | '''|'''
| Logical 'Or'
| align=center | 8
| align=center | '''&lt;'''
| Lesser
|-
| align=center | 4
| align=center | '''='''
| Equal
| align=center | 9
| align=center | '''&lt;='''
| Lesser or equal
|-
| align=center | 5
| align=center | '''!=''' 
| Not equal
| align=center | 10
| align=center | '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>211</id>
      <timestamp>2012-07-02T23:25:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="1222">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7% | Description
! width=1%  | #
! width=3%  | Operator
! width=7% | Description
! width=1%  | #
! width=3%  | Operator
! width=7% | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''&gt;'''
| Greater
|-
| align=center | 2
| align=center | '''&amp;'''
| Logic 'And'
| align=center | 7
| align=center | '''&gt;='''
| Greater or equal
|-
| align=center | 3
| align=center | '''|'''
| Logical 'Or'
| align=center | 8
| align=center | '''&lt;'''
| Lesser
|-
| align=center | 4
| align=center | '''='''
| Equal
| align=center | 9
| align=center | '''&lt;='''
| Lesser or equal
|-
| align=center | 5
| align=center | '''!=''' 
| Not equal
| align=center | 10
| align=center | '''not''' 
| Logical not
|}</text>
    </revision>
    <revision>
      <id>212</id>
      <timestamp>2012-07-02T23:26:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="1227">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if it could be hit by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''&gt;'''
| Greater
|-
| align=center | 2
| align=center | '''&amp;'''
| Logical 'And'
| align=center | 7
| align=center | '''&gt;='''
| Greater or equal
|-
| align=center | 3
| align=center | '''|'''
| Logical 'Or'
| align=center | 8
| align=center | '''&lt;'''
| Lesser
|-
| align=center | 4
| align=center | '''='''
| Equal
| align=center | 9
| align=center | '''&lt;='''
| Lesser or equal
|-
| align=center | 5
| align=center | '''!=''' 
| Not equal
| align=center | 10
| align=center | '''not''' 
| Logical Not
|}</text>
    </revision>
    <revision>
      <id>213</id>
      <timestamp>2012-07-02T23:27:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1228">= Introduction =
Pattern script is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if could be damaged by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''&gt;'''
| Greater
|-
| align=center | 2
| align=center | '''&amp;'''
| Logical 'And'
| align=center | 7
| align=center | '''&gt;='''
| Greater or equal
|-
| align=center | 3
| align=center | '''|'''
| Logical 'Or'
| align=center | 8
| align=center | '''&lt;'''
| Lesser
|-
| align=center | 4
| align=center | '''='''
| Equal
| align=center | 9
| align=center | '''&lt;='''
| Lesser or equal
|-
| align=center | 5
| align=center | '''!=''' 
| Not equal
| align=center | 10
| align=center | '''not''' 
| Logical Not
|}</text>
    </revision>
    <revision>
      <id>214</id>
      <timestamp>2012-07-02T23:27:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="1229">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if could be damaged by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''&gt;'''
| Greater
|-
| align=center | 2
| align=center | '''&amp;'''
| Logical 'And'
| align=center | 7
| align=center | '''&gt;='''
| Greater or equal
|-
| align=center | 3
| align=center | '''|'''
| Logical 'Or'
| align=center | 8
| align=center | '''&lt;'''
| Lesser
|-
| align=center | 4
| align=center | '''='''
| Equal
| align=center | 9
| align=center | '''&lt;='''
| Lesser or equal
|-
| align=center | 5
| align=center | '''!=''' 
| Not equal
| align=center | 10
| align=center | '''not''' 
| Logical Not
|}</text>
    </revision>
    <revision>
      <id>215</id>
      <timestamp>2012-07-02T23:32:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="1608">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used:

* By monsters to check if its a time to spawn/hide
* By gamemodels to check if could be damaged by certain weapon

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}</text>
    </revision>
    <revision>
      <id>232</id>
      <timestamp>2012-07-03T06:46:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="1629">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event.

Pattern scripts are used by:

* Enemy appearance (some enemies are only activa at night, some only at day etc.)
* Gamemodels (could be damaged by certain weapon)

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}</text>
    </revision>
    <revision>
      <id>234</id>
      <timestamp>2012-07-03T07:00:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2132">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, infoportions etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}

= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>235</id>
      <timestamp>2012-07-03T07:00:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2134">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, infoportions etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}



= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>236</id>
      <timestamp>2012-07-03T07:00:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2136">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0. Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, infoportions etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched



= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}



= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>237</id>
      <timestamp>2012-07-03T07:01:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="2156">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}



= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>239</id>
      <timestamp>2012-07-03T07:12:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="2154">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}

= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>240</id>
      <timestamp>2012-07-03T07:13:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2156">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched



= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}

= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>241</id>
      <timestamp>2012-07-03T07:13:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2156">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}


= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, zone (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>242</id>
      <timestamp>2012-07-03T07:13:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2179">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}


= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, [[Zones | zone appearance]] (check if zone is active).

=== GamemodelHitPattern ===</text>
    </revision>
    <revision>
      <id>243</id>
      <timestamp>2012-07-03T07:15:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2314">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|}


= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, [[Zones | zone appearance]] (check if zone is active).

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>244</id>
      <timestamp>2012-07-03T07:18:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2211">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=3 style=&quot;border-collapse: collapse&quot; width=100%
! width=1%  | #
! width=3%  | Operator
! width=7%  | Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, [[Zones | zone appearance]] (check if zone is active).

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>245</id>
      <timestamp>2012-07-03T07:18:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="2163">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}

= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, [[Zones | zone appearance]] (check if zone is active).

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>246</id>
      <timestamp>2012-07-03T07:18:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2164">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functinos is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, [[Zones | zone appearance]] (check if zone is active).

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>247</id>
      <timestamp>2012-07-03T07:19:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="2164">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on monster's appecrance, [[Zones | zone appearance]] (check if zone is active).

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>248</id>
      <timestamp>2012-07-03T07:19:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2136">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>249</id>
      <timestamp>2012-07-03T07:22:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2283">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Example of how patter script looks like:

  // this script check if its a night, if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>250</id>
      <timestamp>2012-07-03T07:25:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2457">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Example of how patter script looks like:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>251</id>
      <timestamp>2012-07-03T07:26:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2459">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Example of how pattern script looks like:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''x &amp; y'''
| Logical 'And'
|-
| align=center | 3
| align=center | '''x | y'''
| Logical 'Or'
|-
| align=center | 4
| align=center | '''x = y'''
| Equal
|-
| align=center | 5
| align=center | '''x != y''' 
| Not equal
|-
| align=center | 6
| align=center | '''x &gt; y '''
| Greater
|-
| align=center | 7
| align=center | '''x &gt;= y'''
| Greater or equal
|-
| align=center | 8
| align=center | '''x &lt; y'''
| Lesser
|-
| align=center | 9
| align=center | '''x &lt;= y'''
| Lesser or equal
|-
| align=center | 10
| align=center | '''x &amp; not y''' 
| Logical Not
|-
| align=center | 11
| align=center | '''x &gt;&lt; start end '''
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''x =&gt;&lt; start end '''
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''x &gt;&lt;= start end '''
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''x =&gt;&lt;= start end '''
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>252</id>
      <timestamp>2012-07-03T07:28:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2455">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Example of how pattern script looks like:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| align=center | 1
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>253</id>
      <timestamp>2012-07-03T07:32:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2830">= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Example of how pattern script looks like:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>695</id>
      <timestamp>2012-07-15T02:07:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2854">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event, checks for special conditions. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Example of how pattern script looks like:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>980</id>
      <timestamp>2012-07-17T05:08:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2823">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Example of how pattern script looks like:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>981</id>
      <timestamp>2012-07-17T05:09:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2795">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0.

Pattern scripts are used to determine availability of some functionality or event. 

Pattern scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Example of things controlled by pattern scripts:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>982</id>
      <timestamp>2012-07-17T05:10:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2754">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Pattern scripts could be used for:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>983</id>
      <timestamp>2012-07-17T05:11:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2735">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern realisations. There is two pattern realizations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>984</id>
      <timestamp>2012-07-17T05:12:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="2740">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

Pattern functions used by [[misc_gamemodel | Gamemodels]] to determine, if break animation is available for a certain type of weapon.</text>
    </revision>
    <revision>
      <id>1020</id>
      <timestamp>2012-07-17T10:37:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3576">{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Example
! Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! #
! Operator
! Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1021</id>
      <timestamp>2012-07-17T10:37:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3702">{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1022</id>
      <timestamp>2012-07-17T10:40:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3703">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1023</id>
      <timestamp>2012-07-17T10:42:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="3741">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

=== GamemodelHitPattern ===

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1024</id>
      <timestamp>2012-07-17T12:12:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4139">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''entity'''.''field''
|
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1025</id>
      <timestamp>2012-07-17T19:09:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4155">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''entity'''.''field''
|
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1026</id>
      <timestamp>2012-07-17T20:06:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="4698">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists
* touchable - entity is touchable trigger
* fired - one-call trigger was fired and deactivated (trigger_once, trigger_redirect, trigger_multi with ONCE spawnflag etc.)
* solved - puzzle trigger is solved
* killed - entity was killed (deadflag is set)
* dist ''boundaries'' - check distance to activator within boundaries (see boundaries macro)
* deadtime ''boundaries'' - check time enemy being dead (0 if not dead)
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}</text>
    </revision>
    <revision>
      <id>1027</id>
      <timestamp>2012-07-17T20:07:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="4821">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Operators =

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{{hidden begin | GenericPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists
* touchable - entity is touchable trigger
* fired - one-call trigger was fired and deactivated (trigger_once, trigger_redirect, trigger_multi with ONCE spawnflag etc.)
* solved - puzzle trigger is solved
* killed - entity was killed (deadflag is set)
* dist ''boundaries'' - check distance to activator within boundaries (see boundaries macro)
* deadtime ''boundaries'' - check time enemy being dead (0 if not dead)
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}
{{hidden end}}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1028</id>
      <timestamp>2012-07-17T20:14:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4810">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Expression operators =

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{{hidden begin | GenericPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists
* touchable - entity is touchable trigger
* fired - one-call trigger was fired and deactivated (trigger_once, trigger_redirect, trigger_multi with ONCE spawnflag etc.)
* solved - puzzle trigger is solved
* killed - entity was killed (deadflag is set)
* dist ''x'' ''operator'' - check distance to activator
* deadtime ''x'' ''operator'' - check time enemy being dead
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}
{{hidden end}}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1029</id>
      <timestamp>2012-07-17T20:16:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4843">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Expression operators =

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{{hidden begin | GenericPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}
{{hidden end}}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1030</id>
      <timestamp>2012-07-17T20:16:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4784">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Expression operators =

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1031</id>
      <timestamp>2012-07-17T20:17:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4785">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Expression operators =

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1032</id>
      <timestamp>2012-07-17T20:19:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="4793">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Expression operators =

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1033</id>
      <timestamp>2012-07-17T20:21:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Expression operators */</comment>
      <text xml:space="preserve" bytes="4871">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


= Expression operators =

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| colspan=3 | '''Boolean operators (only applicable between expressions)'''
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1034</id>
      <timestamp>2012-07-17T20:21:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Expression operators */</comment>
      <text xml:space="preserve" bytes="4873">{{article unfinished}}

= Introduction =
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched


Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining


== Expression operators ==

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | #
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| colspan=3 | '''Boolean operators (only applicable between expressions)'''
|-
| align=center | 1
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | 2
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | 3
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | 4
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | 5
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | 6
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | 7
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | 8
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | 9
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | 10
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| align=center | 11
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | 12
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | 13
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | 14
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

= Functions =

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1035</id>
      <timestamp>2012-07-17T20:23:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4626">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Expression operators ==

Link expressions together.

{| border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF | Operator
! bgcolor=#EEDFDF | Example
! bgcolor=#EEDFDF | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1036</id>
      <timestamp>2012-07-17T20:23:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Expression operators */</comment>
      <text xml:space="preserve" bytes="4666">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Expression operators ==

Link expressions together.

{| width=600 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=25% | Example
! bgcolor=#EEDFDF width=65% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1037</id>
      <timestamp>2012-07-17T20:24:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4655">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=600 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=25% | Example
! bgcolor=#EEDFDF width=65% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1062</id>
      <timestamp>2012-07-17T20:52:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4656">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=600 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=25% | Example
! bgcolor=#EEDFDF width=65% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1063</id>
      <timestamp>2012-07-17T20:57:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4656">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=25% | Example
! bgcolor=#EEDFDF width=65% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}


== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1064</id>
      <timestamp>2012-07-17T20:57:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="4655">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
|
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
|
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
|
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1065</id>
      <timestamp>2012-07-17T21:07:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4934">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1066</id>
      <timestamp>2012-07-17T21:19:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5042">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'. Must be always separated by space.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'. Must be always separated by space.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not. Must be always separated by space.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1067</id>
      <timestamp>2012-07-17T21:20:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="5078">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''(''' ''expression'' ''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'. Must be always separated by space.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'. Must be always separated by space.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not. Must be always separated by space.
|-
| colspan=3 | '''Comparison operators''' (must be always separated by space)
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1068</id>
      <timestamp>2012-07-17T21:20:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="5076">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'. Must be always separated by space.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'. Must be always separated by space.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not. Must be always separated by space.
|-
| colspan=3 | '''Comparison operators''' (must be always separated by space)
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1069</id>
      <timestamp>2012-07-17T21:24:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5236">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0 used to determine availability of some functionality or event. This scripts can check for very wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.).

Usage examples:

* Enemy appearance (some enemies are only active at night, some only at day etc.)
* Gamemodels damage masks (checks if could be damaged by certain weapon)
* Checking if trigger could be touched

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'. Must be always separated by space.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'. Must be always separated by space.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not. Must be always separated by space.
|-
| colspan=3 | '''Comparison operators''' (must be always separated by space)
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1070</id>
      <timestamp>2012-07-17T21:28:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5278">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==

Link expressions together.

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'. Must be always separated by space.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'. Must be always separated by space.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not. Must be always separated by space.
|-
| colspan=3 | '''Comparison operators''' (must be always separated by space)
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1071</id>
      <timestamp>2012-07-17T21:29:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="5249">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'. Must be always separated by space.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'. Must be always separated by space.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not. Must be always separated by space.
|-
| colspan=3 | '''Comparison operators''' (must be always separated by space)
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1072</id>
      <timestamp>2012-07-17T21:29:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="5108">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Description
|-
| '''true'''
| Always returns 1
|-
| '''false'''
| Always returns 0
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns 1 if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns 1 with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Check if weapon have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1088</id>
      <timestamp>2012-07-17T22:32:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6146">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Script activator is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Script activator is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using [[Gametime | string gametime representation]]. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using [[Gametime | float gametime representation (daytime)]].
|-
| '''moontime''' x ''operator''
| Gametime check using [[Gametime | float gametime representation (moontime)]].
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1089</id>
      <timestamp>2012-07-17T22:34:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6116">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Script activator is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Script activator is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string [[Gametime | gametime]] representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1090</id>
      <timestamp>2012-07-17T22:34:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6124">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Script activator is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Script activator is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string [[Gametime | gametime]] representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1091</id>
      <timestamp>2012-07-17T22:35:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6113">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Script activator is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Script activator is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1093</id>
      <timestamp>2012-07-17T22:51:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6347">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Activator has this infoportion
|-
| colspan=2 | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1094</id>
      <timestamp>2012-07-17T22:52:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="6405">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1095</id>
      <timestamp>2012-07-17T22:52:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="6437">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 bgcolor=#DDDDDD | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 bgcolor=#DDDDDD | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1096</id>
      <timestamp>2012-07-17T22:53:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6469">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 bgcolor=#EEEEEE | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 bgcolor=#EEEEEE | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 bgcolor=#EEEEEE | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 bgcolor=#EEEEEE | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1097</id>
      <timestamp>2012-07-17T22:53:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="6485">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! bgcolor=#EEDFDF width=10% | Operator
! bgcolor=#EEDFDF width=20% | Example
! bgcolor=#EEDFDF width=70% | Description
|-
| colspan=3 bgcolor=#EEEEEE | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 bgcolor=#EEEEEE | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 bgcolor=#EEEEEE | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 bgcolor=#EEEEEE | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 bgcolor=#EEEEEE | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% bgcolor=#EEDFDF | Operator
! width=75% bgcolor=#EEDFDF | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1111</id>
      <timestamp>2012-07-17T23:09:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6413">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
! colspan=3 style=&quot;text-align:left&quot; | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
! colspan=3 style=&quot;text-align:left&quot; | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
! colspan=2 style=&quot;text-align:left&quot; | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
! colspan=2 style=&quot;text-align:left&quot; | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
! colspan=2 style=&quot;text-align:left&quot; | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1113</id>
      <timestamp>2012-07-17T23:13:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6338">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=th | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=th | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=th | '''Entity checks'''
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=th | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=th | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1114</id>
      <timestamp>2012-07-17T23:14:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6314">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=th | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=th | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| true
| Always yes
|-
| false
| Always no
|-
| colspan=2 class=th | Entity checks
|-
| self.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=th | '''Activator checks'''
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=th | '''[[Gametime]] checks'''
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1115</id>
      <timestamp>2012-07-17T23:15:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6320">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=th | '''Logical operators (only applicable between expressions)'''
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=th | '''Comparison operators'''
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=th | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=th | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=th | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1116</id>
      <timestamp>2012-07-17T23:15:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Operators */</comment>
      <text xml:space="preserve" bytes="6308">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=th | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=th | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=th | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=th | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=th | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1120</id>
      <timestamp>2012-07-17T23:20:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6328">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''raining'''
| Check if it is raining or snow.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1123</id>
      <timestamp>2012-07-17T23:22:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="6371">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| [[Gametime]] hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1124</id>
      <timestamp>2012-07-17T23:23:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="6367">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* found - entity exists.
* touchable - entity is touchable trigger or zone.
* fired - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* solved - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* killed - entity was killed (deadflag is set).
* dist ''x'' ''operator'' - check distance to activator.
* deadtime ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1125</id>
      <timestamp>2012-07-17T23:23:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="6409">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* slash - sword
* crush - mace
* crushblow - mace special hit
* hack - axe
* impale - throwing knifes, arrows
* teeth - animals
* claw - animals, wolf form
* water - water damage
* energy - energy bolts, magic missiles
* spikes - spike zones
* flame - fire, flame sword
* flaying - flay artefact
* imploding - implode artefact
* soulreaver - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1126</id>
      <timestamp>2012-07-17T23:24:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6493">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}

=== GamemodelHitPattern ===

Used on [[misc_gamemodel]] when model is hit.

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1127</id>
      <timestamp>2012-07-17T23:31:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="6446">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}

=== GamemodelHitPattern ===

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1128</id>
      <timestamp>2012-07-17T23:32:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="6447">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}</text>
    </revision>
    <revision>
      <id>1129</id>
      <timestamp>2012-07-17T23:32:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6483">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this infoportion
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1133</id>
      <timestamp>2012-07-17T23:35:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6501">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportion | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1134</id>
      <timestamp>2012-07-17T23:36:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6502">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1135</id>
      <timestamp>2012-07-17T23:37:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6556">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

=====true====
:Always yes

=====false====
:Always no

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1136</id>
      <timestamp>2012-07-17T23:37:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6550">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1137</id>
      <timestamp>2012-07-17T23:37:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6556">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

======true======
:Always yes

'''false'''
:Always no

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1138</id>
      <timestamp>2012-07-17T23:37:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6554">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

=====true=====
:Always yes

'''false'''
:Always no

{{hidden begin | GamemodelHitPattern functions}}
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| '''pushonly'''
| System word. Allows to push object but not destroy. This should be the first operator in expression if used.
|-
| '''tag_''tagname'''''
| Returns true if model tag closest to hit position matches this tag. Otherwise 0.
|-
| '''''number''%'''
| Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.
|-
| '''''damagetype'''''
| Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
|}
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1139</id>
      <timestamp>2012-07-17T23:38:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6284">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''damagetype'''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
* '''slash''' - sword
* '''crush''' - mace
* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1140</id>
      <timestamp>2012-07-17T23:39:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6287">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''damagetype'''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
* '''hack''' - axe
* '''impale''' - throwing knifes, arrows
* '''teeth''' - animals
* '''claw''' - animals, wolf form
* '''water''' - water damage
* '''energy''' - energy bolts, magic missiles
* '''spikes''' - spike zones
* '''flame''' - fire, flame sword
* '''flaying''' - flay artefact
* '''imploding''' - implode artefact
* '''soulreaver''' - soul reaver magic attack
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1141</id>
      <timestamp>2012-07-17T23:39:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6298">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''damagetype'''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1142</id>
      <timestamp>2012-07-17T23:39:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6304">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

''''''damagetype''''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1143</id>
      <timestamp>2012-07-17T23:39:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6302">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack
{{hidden end}}

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1144</id>
      <timestamp>2012-07-17T23:40:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GamemodelHitPattern */</comment>
      <text xml:space="preserve" bytes="6287">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=25% | Operator
! width=75% | Check for
|-
| '''true'''
| Always yes
|-
| '''false'''
| Always no
|-
| colspan=2 class=shadow | Entity checks
|-
| '''self'''.''field''
| Checks one of the field of script owner. Fields could be:
* '''found''' - entity exists.
* '''touchable''' - entity is touchable trigger or zone.
* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
* '''killed''' - entity was killed (deadflag is set).
* '''dist''' ''x'' ''operator'' - check distance to activator.
* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.
|-
| '''enemy'''.''field''
| Check field of script owner enemy. See fields list above.
|-
| '''target&lt;'''''name'''''&gt;'''.''field''
| Find entity by targetname (return first match). See fields list above.
|-
| '''enemy&lt;'''''radius'''''&gt;'''.''field''
| Find enemy of script owner within given radius. See fields list above.
|-
| '''sid&lt;'''''name'''''&gt;'''.''field''
| Find entity by [[SaveId]]. See fields list above.
|-
| colspan=2 class=shadow | Activator checks
|-
| '''player'''
| Script activator is player.
|-
| '''monster'''
| Is [[Radiant Glossary | NPC]].
|-
| '''posessed'''
| Is [[Radiant Glossary | NPC]] posessed by player.
|-
| '''info''' ''infoportion''
| Activator has this [[Infoportions | infoportion]]
|-
| '''infovalue''' ''infoportion'' ''operator''
| Infoportion value comparison (false is always returned is there is no such infoportion).
|-
| colspan=2 class=shadow | [[Gametime]] checks
|-
| '''fullmoon'''
| Moon is on full state (note that moon can be on full state at day).
|-
| '''newmoon'''
| Moon is on null state.
|-
| '''morning'''
| Gametime hour is within 5.00 - 9.59.
|-
| '''day'''
| Gametime hour is within 10.00 - 18.59.
|-
| '''evening'''
| Gametime hour is within 19.00 - 22.59.
|-
| '''night'''
| Gametime hour is within 23.00 - 4.59.
|-
| '''hour''' x ''operator''
| Gametime hour is within some bounds.
|-
| '''time''' x ''operator''
| Gametime check using string gametime representation. All operators are supported.
|-
| '''daytime''' x ''operator''
| Gametime check using float gametime representation (daytime).
|-
| '''moontime''' x ''operator''
| Gametime check using float gametime representation (moontime).
|-
| colspan=2 class=shadow | Other checks
|-
| '''raining'''
| Check if it is raining or snow.
|}


=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1145</id>
      <timestamp>2012-07-17T23:42:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5967">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

==== Entity checks ====

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists.
:* '''touchable''' - entity is touchable trigger or zone.
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
:* '''killed''' - entity was killed (deadflag is set).
:* '''dist''' ''x'' ''operator'' - check distance to activator.
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

==== Activator checks ====

'''player'''
:Script activator is player.

'''monster'''
:Is [[Radiant Glossary | NPC]].

'''posessed'''
:Is [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

==== [[Gametime]] checks ====

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''morning'''
:Gametime hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

==== Other checks ====

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1146</id>
      <timestamp>2012-07-17T23:43:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="5922">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists.
:* '''touchable''' - entity is touchable trigger or zone.
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
:* '''killed''' - entity was killed (deadflag is set).
:* '''dist''' ''x'' ''operator'' - check distance to activator.
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

==== Other checks ====

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1147</id>
      <timestamp>2012-07-17T23:44:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="5898">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists.
:* '''touchable''' - entity is touchable trigger or zone.
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi.
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle.
:* '''killed''' - entity was killed (deadflag is set).
:* '''dist''' ''x'' ''operator'' - check distance to activator.
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead.

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1164</id>
      <timestamp>2012-07-17T23:58:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* GenericPattern */</comment>
      <text xml:space="preserve" bytes="5891">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Patters script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1201</id>
      <timestamp>2012-07-18T00:45:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5891">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns pattern comparison
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1202</id>
      <timestamp>2012-07-18T00:46:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5879">{{article unfinished}}

== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns script
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1220</id>
      <timestamp>2012-07-18T09:24:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5855">== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns script
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''()'') should be separated by space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>1785</id>
      <timestamp>2012-07-26T10:45:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5866">== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns script
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''('' and '')'') should be separated with space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>2762</id>
      <timestamp>2012-10-10T10:22:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Functions */</comment>
      <text xml:space="preserve" bytes="5866">== Introduction ==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

=== Script input ===
* Pattern - script string
* Script owner - entity that owns script
* Script activator - entity that launched comparison event

=== Script rules ===
* Instructions are case sensative
* Operators (excluding ''('' and '')'') should be separated with space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

== Operators ==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

== Functions ==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

=== GenericPattern ===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant/Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant/Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

=== GamemodelHitPattern ===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

== See also ==
* [[Trigger event]]</text>
    </revision>
    <revision>
      <id>2903</id>
      <timestamp>2012-11-23T01:21:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5863">{{TOCRIGHT}}
==Introduction==
Pattern scripts is special kind of expressions that returns 1 or 0. Script can check and combine wide range of conditions (gametime, special parms of entities, [[Infoportions | infoportions]] etc.). Pattern script are used for enemy appearance, gamemodel damage masks, trigger touchability and other events which only need to control availability of some action.

===Script input===
* Pattern - script string
* Script owner - entity that owns script
* Script activator - entity that launched comparison event

===Script rules===
* Instructions are case sensative
* Operators (excluding ''('' and '')'') should be separated with space or tab.
* Null script always returns 1

Basic syntax:

  // this script check if its a night or if there is an enemy within 300 units
  night | enemy&lt;300&gt;.found

  // this scripts check if gametime is between 12 and 14 hours
  hour =&gt;&lt;= 12 14

  // this script check if it's fullmoon night or raining 
  (night &amp; fullmoon) | raining

==Operators==
{| width=800 border=1 cellspacing=0 cellpadding=5 style=&quot;border-collapse: collapse&quot;
! width=10% | Operator
! width=20% | Example
! width=70% | Description
|-
| colspan=3 class=shadow | Logical operators (only applicable between expressions)
|-
| align=center | '''( )'''
| align=center | '''('''''expression''''')''' 
| Expression
|-
| align=center | '''&amp;'''
| align=center | x '''&amp;''' y
| Logical 'And'.
|-
| align=center | '''|'''
| align=center | x '''|''' y
| Logical 'Or'.
|-
| align=center | '''not'''
| align=center | x &amp; '''not''' y 
| Logical Not.
|-
| colspan=3 class=shadow | Comparison operators
|-
| align=center | '''='''
| align=center | x '''=''' y
| Equal
|-
| align=center | '''!='''
| align=center | x '''!=''' y 
| Not equal
|-
| align=center | '''&gt;'''
| align=center | x '''&gt;''' y 
| Greater
|-
| align=center | '''&gt;='''
| align=center | x '''&gt;=''' y
| Greater or equal
|-
| align=center | '''&lt;'''
| align=center | x '''&lt;''' y
| Lesser
|-
| align=center | '''&lt;='''
| align=center | x '''&lt;=''' y
| Lesser or equal
|-
| align=center | '''&gt;&lt;'''
| align=center | x '''&gt;&lt;''' start end
| x &gt; start And x &lt; end
|-
| align=center | '''=&gt;&lt;'''
| align=center | x '''=&gt;&lt;''' start end
| x &gt;= start And x &lt; end
|-
| align=center | '''&gt;&lt;='''
| align=center | x '''&gt;&lt;=''' start end
| x &gt; start And x &lt;= end
|-
| align=center | '''=&gt;&lt;='''
| align=center | x '''=&gt;&lt;=''' start end
| x &gt;= start And x &lt;= end
|}

==Functions==

Set of functions is determined by pattern implementation. There is two pattern implementations as of yet.

===GenericPattern===

This is generic appearance pattern. It used on enemies appearance, [[Zones | zone appearance]].

'''true'''
:Always yes

'''false'''
:Always no

'''self'''.''field''
:Checks one of the field of script owner. Fields could be:
:* '''found''' - entity exists
:* '''touchable''' - entity is touchable trigger or zone
:* '''fired''' - trigger is deactivated. This is only applicable to: trigger_once, trigger_redirect, trigger_multi
:* '''solved''' - puzzle trigger is solved. This is only applicable to: trigger_puzzle
:* '''killed''' - entity was killed (deadflag is set)
:* '''dist''' ''x'' ''operator'' - check distance to activator
:* '''deadtime''' ''x'' ''operator'' - check time enemy being dead

'''enemy'''.''field''
:Check field of script owner enemy. See fields list above.

'''target&lt;'''''name'''''&gt;'''.''field''
:Find entity by targetname (return first match). See fields list above.

'''enemy&lt;'''''radius'''''&gt;'''.''field''
:Find enemy of script owner within given radius. See fields list above.

'''sid&lt;'''''name'''''&gt;'''.''field''
:Find entity by [[SaveId]]. See fields list above.

'''player'''
:Script activator is player.

'''monster'''
:Script activator is [[Radiant/Glossary | NPC]].

'''posessed'''
:Script activator is  [[Radiant/Glossary | NPC]] posessed by player.

'''info''' ''infoportion''
:Activator has this [[Infoportions | infoportion]]

'''infovalue''' ''infoportion'' ''operator''
:Infoportion value comparison (false is always returned is there is no such infoportion).

'''morning'''
:[[Gametime]] hour is within 5.00 - 9.59.

'''day'''
:Gametime hour is within 10.00 - 18.59.

'''evening'''
:Gametime hour is within 19.00 - 22.59.

'''night'''
:Gametime hour is within 23.00 - 4.59.

'''hour''' x ''operator''
:Gametime hour is within some bounds.

'''time''' x ''operator''
:Gametime check using string gametime representation. All operators are supported.

'''daytime''' x ''operator''
:Gametime check using float gametime representation (daytime).

'''moontime''' x ''operator''
:Gametime check using float gametime representation (moontime).

'''fullmoon'''
:Moon is on full state (note that moon can be on full state at day).

'''newmoon'''
:Moon is on null state.

'''raining'''
:Check if it is raining or snow.

===GamemodelHitPattern===

'''true'''
:Always yes

'''false'''
:Always no

'''pushonly'''
:System word. Allows to push object but not destroy. This should be the first operator in expression if used.

'''tag_''tagname'''''
:Returns true if model tag closest to hit position matches this tag. Otherwise 0.

'''''number''%'''
:Randomly returns true with this chance percentage. Typical values are 25%, 50%, 90% etc.

'''''damagetype'''''
:Weapon that was used to hit model have this damage type. Damagetype should be one of following constants:
:* '''slash''' - sword
:* '''crush''' - mace
:* '''crushblow''' - mace special hit
:* '''hack''' - axe
:* '''impale''' - throwing knifes, arrows
:* '''teeth''' - animals
:* '''claw''' - animals, wolf form
:* '''water''' - water damage
:* '''energy''' - energy bolts, magic missiles
:* '''spikes''' - spike zones
:* '''flame''' - fire, flame sword
:* '''flaying''' - flay artefact
:* '''imploding''' - implode artefact
:* '''soulreaver''' - soul reaver magic attack

==See also==
* [[Trigger event]]</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian</title>
    <ns>0</ns>
    <id>592</id>
      <sha1>ac5ub7y16protttjy6xykc8pqc1bywy</sha1>
    <revision>
      <id>3347</id>
      <timestamp>2013-01-15T13:29:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;stub&quot;</comment>
      <text xml:space="preserve" bytes="4">stub</text>
    </revision>
    <revision>
      <id>3352</id>
      <timestamp>2013-01-15T13:54:29Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="511">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Blood Omnicide goals and features | Obiettivi e caratteristiche]]
* [[Blood Omnicide complete feature list | Lista completa delle caratteristiche]]
* [[Blood Omnicide team|Il Team di sviluppo]]

{{initalian}}</text>
    </revision>
    <revision>
      <id>3354</id>
      <timestamp>2013-01-15T15:24:39Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="568">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[http://omnicide.legacy-of-kain.ru/w/index.php/Portal:InItalian/Obiettivi_e_caratteristiche | Obiettivi e caratteristiche]]
* [[Blood Omnicide complete feature list | Lista completa delle caratteristiche]]
* [[Blood Omnicide team|Il Team di sviluppo]]

{{initalian}}</text>
    </revision>
    <revision>
      <id>3355</id>
      <timestamp>2013-01-15T15:25:13Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="522">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Blood Omnicide complete feature list | Lista completa delle caratteristiche]]
* [[Blood Omnicide team|Il Team di sviluppo]]

{{initalian}}</text>
    </revision>
    <revision>
      <id>3359</id>
      <timestamp>2013-01-16T14:23:21Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="539">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Blood Omnicide team|Il Team di sviluppo]]

{{initalian}}</text>
    </revision>
    <revision>
      <id>3362</id>
      <timestamp>2013-01-20T12:46:20Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="558">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]

{{initalian}}</text>
    </revision>
    <revision>
      <id>3363</id>
      <timestamp>2013-01-20T12:59:51Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="874">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omnen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* Formati dei file
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* Pack di traduzione
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian}}</text>
    </revision>
    <revision>
      <id>3365</id>
      <timestamp>2013-01-20T13:31:25Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="873">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* Formati dei file
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* Pack di traduzione
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian}}</text>
    </revision>
    <revision>
      <id>3366</id>
      <timestamp>2013-01-20T13:48:42Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="891">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* Formati dei file
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* Pack di traduzione
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3373</id>
      <timestamp>2013-01-20T18:00:10Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="933">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* Formati dei file
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3375</id>
      <timestamp>2013-01-20T21:31:43Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="968">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3376</id>
      <timestamp>2013-01-20T21:32:16Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="987">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3381</id>
      <timestamp>2013-01-21T17:48:00Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1017">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3388</id>
      <timestamp>2013-01-21T18:01:10Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1048">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalia/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3389</id>
      <timestamp>2013-01-22T12:13:01Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1049">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3390</id>
      <timestamp>2013-01-22T12:16:39Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1063">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* Concept art
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* Funzionamento di SVN repository
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3391</id>
      <timestamp>2013-01-22T12:18:37Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1118">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* Concept art
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Funzionamento di SVN repository | Funzionamento di SVN repository]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3392</id>
      <timestamp>2013-01-22T12:20:38Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1128">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* Concept art
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Funzionamento del repositorio di SVN | Funzionamento del repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3397</id>
      <timestamp>2013-01-22T12:30:04Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1110">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* Concept art
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* Formati dei file
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3422</id>
      <timestamp>2013-01-22T14:37:38Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1142">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* Concept art
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:Formati_di_file | Formati dei file]]
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3423</id>
      <timestamp>2013-01-22T14:46:58Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1168">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* Personaggi
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:Formati_di_file | Formati dei file]]
* Glossario
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3427</id>
      <timestamp>2013-01-22T15:26:28Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1263">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
* [[:Category:Oggetti|Oggetti]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:Formati_di_file | Formati dei file]]
* [[:Category:Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3429</id>
      <timestamp>2013-01-22T15:29:38Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1262">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati di file]]
* [[:Category:Oggetti|Oggetti]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:Formati_di_file | Formati dei file]]
* [[:Category:Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3430</id>
      <timestamp>2013-01-22T15:29:49Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1261">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati di file]]
* [[:Category:Oggetti|Oggetti]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:Formati_di_file | Formati di file]]
* [[:Category:Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3474</id>
      <timestamp>2013-01-22T19:15:59Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1301">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati di file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_di_file | Formati di file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3485</id>
      <timestamp>2013-01-22T19:57:05Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1301">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[:Category:InItalian/Oggetti|Oggetti]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati di file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_di_file | Formati di file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3490</id>
      <timestamp>2013-01-22T21:39:09Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Undo revision 3485 by [[Special:Contributions/Lofo1993|Lofo1993]] ([[User talk:Lofo1993|talk]])</comment>
      <text xml:space="preserve" bytes="1301">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati di file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_di_file | Formati di file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3493</id>
      <timestamp>2013-01-23T13:28:47Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1310">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati di file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_di_file | Formati di file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3510</id>
      <timestamp>2013-01-24T14:16:12Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1312">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_di_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3540</id>
      <timestamp>2013-01-24T18:16:58Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1313">&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;

&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Main Page | Pagina principale inglese di Blood Omen Wiki]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
{{initalian|Pagina principale}}</text>
    </revision>
    <revision>
      <id>3585</id>
      <timestamp>2013-02-14T15:39:59Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2795">= Wiki di sviluppo di Blood Omnicide =
&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Community_portal | Community portal]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(da tradurre!)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Blood Wiki in italiano}}</text>
    </revision>
    <revision>
      <id>3586</id>
      <timestamp>2013-02-14T15:41:00Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2782">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti alla pagina principale della versione italiana di Blood Wiki. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(da tradurre!)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki di sviluppo di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3587</id>
      <timestamp>2013-02-14T15:46:12Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2811">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(da tradurre!)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3588</id>
      <timestamp>2013-02-14T15:50:25Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2912">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* Mondo di gioco
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(da tradurre!)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3589</id>
      <timestamp>2013-02-14T15:54:04Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2936">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(da tradurre!)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3615</id>
      <timestamp>2013-03-23T18:06:49Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2940">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;limit_changes=50&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3616</id>
      <timestamp>2013-03-23T18:14:01Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2971">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Darkplaces engine| Engine overview]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3624</id>
      <timestamp>2013-03-23T18:30:48Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3002">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Darkplaces virtual file system | Virtual file system]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3626</id>
      <timestamp>2013-03-23T20:34:04Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3033">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Portal:InItalian/Virtual_file_system_di_DarkPlaces | Virtual file system del motore]]
* [[Darkplaces material system | Material system]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3628</id>
      <timestamp>2013-03-23T20:41:04Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3065">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;SVN Change Log&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Portal:InItalian/Virtual_file_system_di_DarkPlaces | Virtual file system del motore]]
* [[Portal:InItalian/Sistema_dei_materiali_di_DarkPlaces | Sistema dei materiali]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3646</id>
      <timestamp>2013-04-18T15:54:56Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3285">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
'''Al momento abbiamo dei problemi con il flusso RSS di SVN. Siamo spiacenti.'''

'''Potete trovare [http://www.svn2rss.ru/svn.show.php?id=25 qui] il registro vero e proprio delle modifiche di SVN.'''


&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Portal:InItalian/Virtual_file_system_di_DarkPlaces | Virtual file system del motore]]
* [[Portal:InItalian/Sistema_dei_materiali_di_DarkPlaces | Sistema dei materiali]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3648</id>
      <timestamp>2013-06-13T21:53:34Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3082">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, ossia la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Portal:InItalian/Virtual_file_system_di_DarkPlaces | Virtual file system del motore]]
* [[Portal:InItalian/Sistema_dei_materiali_di_DarkPlaces | Sistema dei materiali]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3653</id>
      <timestamp>2013-06-15T20:10:36Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3076">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://svn.icculus.org/razorwind/trunk/bo1/?view=query&amp;dir=&amp;file=&amp;file_match=exact&amp;who=&amp;who_match=exact&amp;querysort=date&amp;hours=2&amp;date=explicit&amp;mindate=2000-01-00+00%3A00&amp;maxdate=2999-01-00+00%3A00&amp;limit_changes=0&amp;format=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Portal:InItalian/Virtual_file_system_di_DarkPlaces | Virtual file system del motore]]
* [[Portal:InItalian/Sistema_dei_materiali_di_DarkPlaces | Sistema dei materiali]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
    <revision>
      <id>3689</id>
      <timestamp>2013-10-07T20:25:50Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2916">&lt;center&gt;
{| cellspacing=0 cellpadding=5 style=&quot;table-layout: fixed;border-collapse: collapse; border-color: #DDD; width: 100%&quot;
|colspan=3 valign=top style=&quot;width:60%;border-right: 1px solid #DDD&quot; width=50%|
&lt;font size=&quot;2&quot;&gt;Benvenuti nella versione italiana di Blood Wiki, la Wiki ufficiale di sviluppo di Blood Omnicide. Qui si possono trovare informazioni per modificare ogni aspetto del gioco.&lt;/font&gt;
|rowspan=2 style=&quot;width:40%;vertical-align:top&quot;|&lt;h2&gt;Registro delle modifiche di SVN&lt;/h2&gt;
&lt;rss max=20 date=&quot;(d.m.Y G:i)&quot;&gt;http://omnicide.legacy-of-kain.ru/en/dev/svnlog.feed?type=rss&lt;/rss&gt;
|-
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;La Wiki&lt;/h3&gt;
* [[Portal:InItalian/BloodWiki:Portale_della_community | Portale della community]]
* [[BloodWiki:RecentPages | Pagine recenti]]
&lt;h3&gt;Informazioni generali su Blood Omnicide&lt;/h3&gt;
* [[Portal:InItalian/Obiettivi e caratteristiche | Obiettivi e caratteristiche]]
* [[Portal:InItalian/Lista completa delle caratteristiche | Lista completa delle caratteristiche]]
* [[:Category:Concept art|Concept art]]
* [[Portal:InItalian/Il team di sviluppo | Il team di sviluppo]]
&lt;h3&gt;Blood Omen&lt;/h3&gt;
* [[Blood Omen/Worldmap|Mondo di gioco]]
* [[:Category:InItalian/Personaggi_di_Blood_Omen|Personaggi]]
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file]]
&lt;h3&gt;Blood Wiki in altre lingue&lt;/h3&gt;
* [[Main_Page|Originale inglese]]
* [[Portal:InRussian | Russo]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Linee guida per lo sviluppo&lt;/h3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN | Guida al repositorio di SVN]]
* [[Portal:InItalian/Pack di traduzione | Pack di traduzione]]
* [[:Category:InItalian/Formati_dei_file | Formati dei file]]
* [[:Category:InItalian/Glossario|Glossario]]
&lt;h4&gt;Motore grafico Darkplaces&lt;/h4&gt; ''(in traduzione...)''
* [[Portal:InItalian/Il_motore_grafico_DarkPlaces | Sguardo d'insieme]]
* [[Portal:InItalian/Virtual_file_system_di_DarkPlaces | Virtual file system del motore]]
* [[Portal:InItalian/Sistema_dei_materiali_di_DarkPlaces | Sistema dei materiali]]
* [[Darkplaces effectinfo reference | EffectInfo reference]]
* [[Darkplaces lighting | Lighting]]
&lt;h4&gt;Level editing reference&lt;/h4&gt; ''(da tradurre!)''
* [[Radiant/General reference | General reference]]
* [[Common materials]]
* [[Entity classes]]
|style=&quot;width:20%;padding-top:0px&quot; valign=top|&lt;h3&gt;Scripting reference&lt;/h3&gt; ''(da tradurre!)''
* [[Trigger event]]
* [[Infoportions]]
* [[Pattern script | Pattern scripts]]
* [[Music theme script]]
* [[Map configuration script]]
* [[Gamemodel script]]
* [[Environment script]]
* [[Worldmap script]]
&lt;h4&gt;Tool di sviluppo e altro&lt;/h4&gt;
* [[Portal:InItalian/Blood Pill | Blood Pill]]
* [[:Category:InItalian/Oggetti|Oggetti di gioco]]
* [[RwgTex]]
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[:Category:3ds Max|Tool di 3ds Max]] 
|}
&lt;/center&gt;
__NOTOC__
{{finished}}

{{initalian|Wiki italiana di Blood Omnicide}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Abominio delle caverne</title>
    <ns>0</ns>
    <id>627</id>
      <sha1>id64bnbmufkotactqni11fc5dyl5kkh</sha1>
    <revision>
      <id>3516</id>
      <timestamp>2013-01-24T14:51:14Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination}} Abominio delle caverne - un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca. App...&quot;</comment>
      <text xml:space="preserve" bytes="543">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Cave abomination}}
Abominio delle caverne - un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

==Statistiche==

:Salute: 12
:Danno: 5 per proiettile
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3517</id>
      <timestamp>2013-01-24T14:54:51Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="549">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Abominio delle caverne}}
Abominio delle caverne - un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

==Statistiche==

:Salute: 12
:Danno: 5 per proiettile
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3518</id>
      <timestamp>2013-01-24T14:58:00Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="586">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Abominio delle caverne}}
Abominio delle caverne - un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

==Statistiche==

:Salute: 12
:Danno: 5 per proiettile
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


[[Category:InItalian/Personaggi_di_Blood_Omen]]
{{initalian|Abominio delle caverne}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3521</id>
      <timestamp>2013-01-24T15:52:12Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="588">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Abominio delle caverne}}
Abominio delle caverne - un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

===Statistiche===

:Salute: 12
:Danno: 5 per proiettile
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


[[Category:InItalian/Personaggi_di_Blood_Omen]]
{{initalian|Abominio delle caverne}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3528</id>
      <timestamp>2013-01-24T16:16:43Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="600">{{BoEnemy|cave2|bo_enemy_cave_abomination.gif|Abominio delle caverne}}
L'abominio delle caverne è un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca e fangosa. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

===Statistiche===
:Salute: 12
:Danno: 5 per proiettile
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


[[Category:InItalian/Personaggi_di_Blood_Omen]]
{{initalian|Abominio delle caverne}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3541</id>
      <timestamp>2013-01-24T18:17:58Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="553">{{NemiciBO|cave2|bo_enemy_cave_abomination.gif|Abominio delle caverne}}
L'abominio delle caverne è un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca e fangosa. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

===Statistiche===
:Salute: 12
:Danno: 5 per proiettile
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


{{initalian|Abominio delle caverne}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3561</id>
      <timestamp>2013-01-31T13:45:01Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="556">{{NemiciBO|cave2|bo_enemy_cave_abomination.gif|Abominio delle caverne}}
L'abominio delle caverne è un orrendo mostro che scaglia proiettili composti di una qualche sostanza sporca e fangosa. Appare per la prima volta nelle caverne dell'Oracolo di Nosgoth.

===Statistiche===
:Salute: 12
:Danno: 5 (ogni proiettile)
:Sangue: verde
:Velocità di moviemento: media
:Tipo di personaggio: animale
:Entity: [[enemy_cave_abomination]]

==Concept art==
&lt;gallery&gt;
File:Lakdav cave abomination.jpg
&lt;/gallery&gt;


{{initalian|Abominio delle caverne}}
__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/BIH</title>
    <ns>0</ns>
    <id>660</id>
      <sha1>kt8qluqr33ukdneirczb73qxrzxesfm</sha1>
    <revision>
      <id>3660</id>
      <timestamp>2013-07-22T15:52:23Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;La BIH ([http://en.wikipedia.org/wiki/Bounding_interval_hierarchy Bounding Interval Hierarchy], letteralmente &quot;Gerarchia vincolante degli intervalli&quot;) è una struttura di part...&quot;</comment>
      <text xml:space="preserve" bytes="1156">La BIH ([http://en.wikipedia.org/wiki/Bounding_interval_hierarchy Bounding Interval Hierarchy], letteralmente &quot;Gerarchia vincolante degli intervalli&quot;) è una struttura di partizionamento dei dati simile alla [[Portal:InItalian/BSP|BSP]] (Partizione binaria dello spazio, o 'Binary Space Partitioning'). 

Qualche caratteristica generale:
* Tempi di costruzione molto rapidi
* Basso utilizzo di memoria
* Attraversamento semplice e veloce
* Costruzione e algoritmi di attraversamento semplicissimi
* Alta precisione numerica durante la costruzione e l'attraversamento
* Struttura ad albero più piatta (riduce la profondità degli alberi) rispetto ai k-d tree

In DarkPlaces, la BIH è un'implementazione di copertura. Una volta attivata, sostituisce l'implementazione predefinita BSP nel codice in collisione. La BIH è più veloce della BSP, ha bisogno di meno memoria ed è molto più stabile nelle mesh triangolari arbitrarie.

==Variabili della console==
{{cvar|mod_collision_bih|attiva l'uso della BIH. Sempre attiva in Blood Omnicide.}}

[[Category:InItalian/Glossario]]
[[Category:InItalian/Motore grafico DarkPlaces]]
{{finished}}
{{initalian|BIH}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/BSP</title>
    <ns>0</ns>
    <id>657</id>
      <sha1>7feujywlkq6dxzu4o5qsf7yx93ye7g7</sha1>
    <revision>
      <id>3650</id>
      <timestamp>2013-06-15T20:01:02Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;BSP può riferirsi a:  * ([http://en.wikipedia.org/wiki/Binary_space_partitioning Partizione binaria dello spazio]) ‒ una tecnica usata nei videogiochi per il rilevamento de...&quot;</comment>
      <text xml:space="preserve" bytes="516">BSP può riferirsi a:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Partizione binaria dello spazio]) ‒ una tecnica usata nei videogiochi per il rilevamento delle collisioni e la renderizzazione.
* L'estensione dei [[Portal:InItalian/BSP (file) | file dei livelli]] per il motore grafico Quake e i suoi successori.
* Il primo stadio della compilazione dei file dei livelli (vedi sopra).

[[Category:InItalian/Motore grafico Darkplaces]]
[[Category:InItalian/Glossario]]
{{finished}}
{{initalian|BSP}}</text>
    </revision>
    <revision>
      <id>3651</id>
      <timestamp>2013-06-15T20:01:34Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="516">BSP può riferirsi a:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Partizione binaria dello spazio]) ‒ una tecnica usata nei videogiochi per il rilevamento delle collisioni e la renderizzazione.
* L'estensione dei [[Portal:InItalian/BSP (file) | file dei livelli]] per il motore grafico Quake e i suoi successori.
* Il primo stadio della compilazione dei file dei livelli (vedi sopra).

[[Category:InItalian/Motore grafico DarkPlaces]]
[[Category:InItalian/Glossario]]
{{finished}}
{{initalian|BSP}}</text>
    </revision>
    <revision>
      <id>3652</id>
      <timestamp>2013-06-15T20:03:12Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="516">BSP può riferirsi a:

* ([http://en.wikipedia.org/wiki/Binary_space_partitioning Partizione binaria dello spazio]) ‒ una tecnica usata nei videogiochi per la renderizzazione e il rilevamento delle collisioni.
* L'estensione dei [[Portal:InItalian/BSP (file) | file dei livelli]] per il motore grafico Quake e i suoi successori.
* Il primo stadio della compilazione dei file dei livelli (vedi sopra).

[[Category:InItalian/Motore grafico DarkPlaces]]
[[Category:InItalian/Glossario]]
{{finished}}
{{initalian|BSP}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/BSP (file)</title>
    <ns>0</ns>
    <id>647</id>
      <sha1>sxl6ucaqwwcfvg2gs22kaxwotp7v5je</sha1>
    <revision>
      <id>3577</id>
      <timestamp>2013-01-31T18:34:00Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}} File che contiene le geometrie di un livello e gli oggetti, per la Quake Engine e tutte quelle da essa derivate (Id tech 2, Id Tech 3, Goldsrc Engine, Source En...&quot;</comment>
      <text xml:space="preserve" bytes="1064">{{unfinished}}
File che contiene le geometrie di un livello e gli oggetti, per la Quake Engine e tutte quelle da essa derivate (Id tech 2, Id Tech 3, Goldsrc Engine, Source Engine, ecc.).

Il BSP non è adatto alle modifiche dirette. Viene costruito con un file [[MAP]]. Il processo di costruzione si chiama compilazione. La compilazione passa per diverse fasi:

* BSP - la prima fase; le geometrie della mappa vengono convertite in un albero BSP, vengono create tutte le strutture del livello.
* VIS - la visibilità da cluster a cluster viene calcolata.
* LIGHT - l'illuminazione statica (lightmap, lightgrid) biene generata.

Per ogni game Engine la versione e la struttura dei BSP sono diverse.

La Darkplaces Engine può caricare i seguenti tipi di BSP:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide utilizza BSP di Quake 3 per tutti i livelli.

== Vedi anche ==
* [[MAP]]
* [[BModel]]
* [[Q3BSP]]
* [[BIH]]


[[Category:InItalian/Glossario]]
[[Category:InItalian/Formati_dei_file]]
{{initalian|BSP (file)}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3619</id>
      <timestamp>2013-03-23T18:28:58Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1113">{{unfinished}}
File che contiene le geometrie di un livello e gli oggetti, per la Quake Engine e tutte quelle da essa derivate (Id tech 2, Id Tech 3, Goldsrc Engine, Source Engine, ecc.).

Il BSP non è adatto alle modifiche dirette. Viene costruito con un file [[MAP]]. Il processo di costruzione si chiama compilazione. La compilazione passa per diverse fasi:

* BSP - la prima fase; le geometrie della mappa vengono convertite in un albero BSP, vengono create tutte le strutture del livello.
* VIS - la visibilità da cluster a cluster viene calcolata.
* LIGHT - l'illuminazione statica (lightmap, lightgrid) biene generata.

Per ogni game Engine la versione e la struttura dei BSP sono diverse.

La Darkplaces Engine può caricare i seguenti tipi di BSP:
* Quake BSP
* Half-Life BSP
* [[Q3BSP | Quake 3 BSP]]

Blood Omnicide utilizza BSP di Quake 3 per tutti i livelli.

== Vedi anche ==
* [[MAP]]
* [[BModel]]
* [[Q3BSP]]
* [[BIH]]


[[Category:InItalian/Glossario]]
[[Category:InItalian/Motore_grafico_DarkPlaces]]
[[Category:InItalian/Formati_dei_file]]
{{initalian|BSP (file)}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Bestia delle caverne</title>
    <ns>0</ns>
    <id>628</id>
      <sha1>h28yp8wxfjowk1f15qurnfr5tw2qb4v</sha1>
    <revision>
      <id>3520</id>
      <timestamp>2013-01-24T15:51:25Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;==Bestia delle caverne== {{BoEnemy|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}} La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, inc...&quot;</comment>
      <text xml:space="preserve" bytes="1090">==Bestia delle caverne==
{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}
La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.

===Statistiche===

:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}
Esistono due varietà di questo mostro: una di colore marrone e una di colore violastro, con diversi danno da mischia e quantità di salute.

===Statistiche===

:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3522</id>
      <timestamp>2013-01-24T15:55:35Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1099">La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.
Esistono due varietà di questo mostro: una di colore marrone e una di colore violastro, con diversi danno da mischia e quantità di salute.

==Bestia marrone delle caverne==
{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}

===Statistiche===

:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}

===Statistiche===

:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3523</id>
      <timestamp>2013-01-24T16:02:50Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1158">La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.
Esistono due varietà di questo mostro: una marrone e una violastra.

==Bestia marrone delle caverne==
{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}
Il più debole dei due tipi di bestie delle caverne, di colore marrone.

===Statistiche===
:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}
La bestia delle caverne più forte, con più salute e danno.

===Statistiche===
:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3524</id>
      <timestamp>2013-01-24T16:03:30Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1164">La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.
Esistono due varietà di questo mostro: una marrone e una violastra.

==Bestia marrone delle caverne==
{{BoEnemy|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}
Il più debole dei due tipi di bestie delle caverne, di colore marrone/beige.

===Statistiche===
:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}
La bestia delle caverne più forte, con più salute e danno.

===Statistiche===
:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3542</id>
      <timestamp>2013-01-24T18:18:23Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1117">La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.
Esistono due varietà di questo mostro: una marrone e una violastra.

==Bestia marrone delle caverne==
{{NemiciBO|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}
Il più debole dei due tipi di bestie delle caverne, di colore marrone/beige.

===Statistiche===
:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{BoEnemy|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}
La bestia delle caverne più forte, con più salute e danno.

===Statistiche===
:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3543</id>
      <timestamp>2013-01-24T18:18:41Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1118">La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.
Esistono due varietà di questo mostro: una marrone e una violastra.

==Bestia marrone delle caverne==
{{NemiciBO|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}
Il più debole dei due tipi di bestie delle caverne, di colore marrone/beige.

===Statistiche===
:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{NemiciBO|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}
La bestia delle caverne più forte, con più salute e danno.

===Statistiche===
:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3551</id>
      <timestamp>2013-01-26T13:29:34Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1128">La bestia delle caverne (o lupo delle caverne) è un ibrido tra un lupo e un bradipo, incontrato nelle caverne dell'Oracolo e nelle pianure fredde. Si sposta in modo sgraziato ma velocemente; il suo attacco da mischia è lento e può essere facilmente schivato.
Esistono due varietà di questo mostro: una marrone e una violastra.

==Bestia marrone delle caverne==
{{NemiciBO|cave|bo_enemy_cave_wolf.gif|Bestia delle caverne}}
Il più debole dei due tipi di bestie delle caverne, di colore marrone/beige.

===Statistiche===
:Salute: 15
:Danno: 25
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast]]

==Bestia viola delle caverne==
{{NemiciBO|cave2|bo_enemy_cave_purplewolf.gif|Bestia viola delle caverne}}
La bestia delle caverne più forte, con più salute e danno.

===Statistiche===
:Salute: 30
:Danno: 35
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_cave_beast2]]

==Concept art==
&lt;gallery&gt;
File:Amddred_cave_wolf.jpg
File:Enigma cave-wolf-color.jpg
&lt;/gallery&gt;

{{initalian|Bestia delle caverne}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Blood Pill</title>
    <ns>0</ns>
    <id>600</id>
      <sha1>9ap4fsnvqyumc7rcltb9wz3oei1zxxf</sha1>
    <revision>
      <id>3380</id>
      <timestamp>2013-01-21T17:47:18Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{finished}} {{grammar}} [[File:Bloodpill.png|thumb|right|400px]] Blood Pill è un pacchetto di tool per lavorare sui file .BIG. Lo si può usare per visualizzare i dati conte...&quot;</comment>
      <text xml:space="preserve" bytes="4274">{{finished}}
{{grammar}}
[[File:Bloodpill.png|thumb|right|400px]]
Blood Pill è un pacchetto di tool per lavorare sui file .BIG. Lo si può usare per visualizzare i dati contenuti nel file delle risorse '''pill.big''' - di Blood Omen.

Blood Pill è in grado di decodificare tutti i tipi di file usati nel gioco e metterli in una forma in cui possono essere letti o ascoltati: l'audio dei discorsi, le mattonelle, gli sprite, la grafica dei TIM e altro. Solo i file .BIG di Blood Omen sono supportati.

===Caratteristiche===

* Compressione e decompressione dei file .BIG delle versioni pc e PSX di BO
* Conversione automatica TIM &lt;-&gt; TGA durante la compressione e la decompressione
* Conversione automatica ADPCMWAV e OGG grezzi durante la compressione e la decompressione
* Decompressione degli sprite (nemici e oggetti) in immagini TGA separate
* Decompressione delle mattonelle (texture dei livelli) in TGA
* Decompressione i file multioggetto (file &quot;uniti&quot; utilizzati per alcune entry di BO)
* Decodificazione dei video .JAM in .TGA
* Decodificazione dei file VAG in suoni WAV PCM o OGG
* Decodificazione dei livelli in immagini TGA (con, opzionali, le informazioni aggiunte dagli sviluppatori)
* Patching dei file .big
* Fornisce supporto per l'installazione di Blood Omnicide

===Utilizzo===

Blood Pill è un'utility a riga di comando. Per la lista dei comandi va lanciato il programma senza parms. Ci sono anche dei semplici script batch nella cartella &quot;samples/&quot;, che coprono le funzioni più utili:

Script batch campione:

* '''extract_file.bat''' : decomprime un file dal pill.big.
* '''list.bat''' : crea un file-lista del pill.big.
* '''unpack.bat''' : decomprime il pill.big con tutte le conversioni abilitate.
* '''unpack_raw.bat''' : decomprime il pill.big con i tipi puri di file (senza convertire).
* '''unpack_fortranslating.bat''' : decomprime con le conversioni TIM-&gt;TGA e ADPCM-&gt;WAV, il che è utile per realizzare una traduzione di BO per pc.
* '''unpack_oggsounds.bat''' : decomprime pill.big con tutte le conversioni e con i file audio che vengono convertiti in Ogg Vorbis.
* '''pack.bat''' : crea un nuovo pill2.big basato sulla cartella &quot;bigfile&quot; (riconverte tutti i tga e i wav).
* '''tga2tim(test.tga).bat''' : conversione TGA-&gt;TIM.
* '''tim2tga(test.tim).bat''' : conversione TIM-&gt;TGA.
* '''tim2tga(test.tim)_16to24.bat''' : Conversione TIM-&gt;TGA con la conversione 16-&gt;24 abilitata.

Per usare i file batch campione copiarli nella cartella che contiene bpill.exe (dentro deve esserci anche il pill.big).

==Immagini==
====Sprite e mattonelle decompressi====
&lt;gallery&gt;
File:bloodpilltiles.jpg
File:bloodpillsprites.jpg
File:bloodpillsprites2.jpg
&lt;/gallery&gt;

====Frame di file JAM decodificati====
&lt;gallery&gt;
File:jam1.png
File:jam2.png
File:jam3.png
File:jam4.png
File:jam5.png
File:jam6.png
&lt;/gallery&gt;

====Mappe di Blood Omen convertite in TGA====
{|
| valign=top align=center | [[File:bomap1.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap1.jpg]]
| valign=top align=center | [[File:bomap2.jpg|198px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap2.jpg]]
| valign=top align=center | [[File:bomap3.jpg|238px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap3.jpg]]
| valign=top align=center | [[File:bomap4.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap4.jpg]]
|-
| valign=top align=center | [[File:bomap5.jpg|227px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap5.jpg]]
| valign=top align=center | [[File:bomap6.jpg|129px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap6.jpg]]
| valign=top align=center | [[File:bomap7.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap7.jpg]]
| valign=top align=center | [[File:bomap8.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap8.jpg]]
|}
==Download==
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.01.zip Blood Pill v1.01]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.0.zip Blood Pill v1.00]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_0.9.zip Blood Pill v0.9]

==Vedi anche==
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file di Blood Omen]]

{{initalian|Blood Pill}}
[[Category:Tools]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>3597</id>
      <timestamp>2013-02-16T23:43:34Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="4274">{{finished}}
{{grammar}}
[[File:Bloodpill.png|thumb|right|400px]]
Blood Pill è un pacchetto di tool per lavorare sui file .BIG. Lo si può usare per visualizzare i dati contenuti nel file delle risorse '''pill.big''' - di Blood Omen.

Blood Pill è in grado di decodificare tutti i tipi di file usati nel gioco e metterli in una forma in cui possono essere letti o ascoltati: l'audio dei discorsi, le mattonelle, gli sprite, la grafica dei TIM e altro. Solo i file .BIG di Blood Omen sono supportati.

===Caratteristiche===

* Compressione e decompressione dei file .BIG delle versioni PC e PSX di BO
* Conversione automatica TIM &lt;-&gt; TGA durante la compressione e la decompressione
* Conversione automatica ADPCMWAV e OGG grezzi durante la compressione e la decompressione
* Decompressione degli sprite (nemici e oggetti) in immagini TGA separate
* Decompressione delle mattonelle (texture dei livelli) in TGA
* Decompressione i file multioggetto (file &quot;uniti&quot; utilizzati per alcune entry di BO)
* Decodificazione dei video .JAM in .TGA
* Decodificazione dei file VAG in suoni WAV PCM o OGG
* Decodificazione dei livelli in immagini TGA (con, opzionali, le informazioni aggiunte dagli sviluppatori)
* Patching dei file .big
* Fornisce supporto per l'installazione di Blood Omnicide

===Utilizzo===

Blood Pill è un'utility a riga di comando. Per la lista dei comandi va lanciato il programma senza parms. Ci sono anche dei semplici script batch nella cartella &quot;samples/&quot;, che coprono le funzioni più utili:

Script batch campione:

* '''extract_file.bat''' : decomprime un file dal pill.big.
* '''list.bat''' : crea un file-lista del pill.big.
* '''unpack.bat''' : decomprime il pill.big con tutte le conversioni abilitate.
* '''unpack_raw.bat''' : decomprime il pill.big con i tipi puri di file (senza convertire).
* '''unpack_fortranslating.bat''' : decomprime con le conversioni TIM-&gt;TGA e ADPCM-&gt;WAV, il che è utile per realizzare una traduzione di BO per pc.
* '''unpack_oggsounds.bat''' : decomprime pill.big con tutte le conversioni e con i file audio che vengono convertiti in Ogg Vorbis.
* '''pack.bat''' : crea un nuovo pill2.big basato sulla cartella &quot;bigfile&quot; (riconverte tutti i tga e i wav).
* '''tga2tim(test.tga).bat''' : conversione TGA-&gt;TIM.
* '''tim2tga(test.tim).bat''' : conversione TIM-&gt;TGA.
* '''tim2tga(test.tim)_16to24.bat''' : Conversione TIM-&gt;TGA con la conversione 16-&gt;24 abilitata.

Per usare i file batch campione copiarli nella cartella che contiene bpill.exe (dentro deve esserci anche il pill.big).

==Immagini==
====Sprite e mattonelle decompressi====
&lt;gallery&gt;
File:bloodpilltiles.jpg
File:bloodpillsprites.jpg
File:bloodpillsprites2.jpg
&lt;/gallery&gt;

====Frame di file JAM decodificati====
&lt;gallery&gt;
File:jam1.png
File:jam2.png
File:jam3.png
File:jam4.png
File:jam5.png
File:jam6.png
&lt;/gallery&gt;

====Mappe di Blood Omen convertite in TGA====
{|
| valign=top align=center | [[File:bomap1.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap1.jpg]]
| valign=top align=center | [[File:bomap2.jpg|198px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap2.jpg]]
| valign=top align=center | [[File:bomap3.jpg|238px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap3.jpg]]
| valign=top align=center | [[File:bomap4.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap4.jpg]]
|-
| valign=top align=center | [[File:bomap5.jpg|227px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap5.jpg]]
| valign=top align=center | [[File:bomap6.jpg|129px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap6.jpg]]
| valign=top align=center | [[File:bomap7.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap7.jpg]]
| valign=top align=center | [[File:bomap8.jpg|300px|link=http://omnicide.legacy-of-kain.ru/w/images/static/Bomap8.jpg]]
|}
==Download==
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.01.zip Blood Pill v1.01]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_1.0.zip Blood Pill v1.00]
* [http://omnicide.legacy-of-kain.ru/files/bloodpill/bpill_0.9.zip Blood Pill v0.9]

==Vedi anche==
* [[Portal:InItalian/Formati dei file di Blood Omen | Formati dei file di Blood Omen]]

{{initalian|Blood Pill}}
[[Category:Tools]]
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/BloodWiki:Portale della community</title>
    <ns>0</ns>
    <id>648</id>
      <sha1>p18ndhvhkt5sz2endc7x2tf7nkpvwko</sha1>
    <revision>
      <id>3583</id>
      <timestamp>2013-02-14T15:34:18Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Portale della community di Blood Wiki}} ==Piccola guida== Quando scrivete o modificate le pagine, per favore, seguite queste regole:  * Pubblicate solo informaz...&quot;</comment>
      <text xml:space="preserve" bytes="1527">{{DISPLAYTITLE:Portale della community di Blood Wiki}}
==Piccola guida==
Quando scrivete o modificate le pagine, per favore, seguite queste regole:

* Pubblicate solo informazioni relative a Blood Omnicide (storia, sviluppo, problemi).
* Non pubblicate troppi link a pagine esterne.
* Imparate l'utilizzo della sintassi della Wiki e dei template.
* Create dei link per la terminologia specifica, così potranno esserne creati gli articoli in futuro.
* Non linkate due volte alla stessa pagina.
* [[Special:SpecialPages | Non]] met[[Special:SpecialPages | tete]] trop[[Special:SpecialPages | pi]] link. È [[Special:SpecialPages | brutto]] da [[Special:SpecialPages | vedere]].
* Non fate gli idioti o vi banneremo.

==Template==
* [[:Category:Formatting_templates | Template per la formattazione]]
* [[:Category:Special templates | Template speciali]]
* [[:Category:Page marks | Segnalatori di pagina]]

==Pagine su cui lavorare==
* [[BloodWiki:UnfinishedPages | Pagine non finite]]
* [[BloodWiki:ScreenshotRequiredPages | Pagine che necessitano screenshot]]
* [[:Special:WantedPages | Pagine non elencate]]
* [[BloodWiki:WorkInProgress | Pagine in via di sviluppo]]
* [[BloodWiki:UnmarkedPages | Pagine prive di segnalatore]]

==Portali==
* [[:Category:InRussian|Tutte le pagine nel portale &quot;Blood Wiki in Russian&quot;]]
* [[:Category:InItalian|Tutte le pagine nel portale &quot;Blood Wiki in Italian&quot;]]

==Lista delle pagine richieste==
Aggiungi qui una pagina che vuoi che sia creata.

__NOTOC__
{{initalian|Portale della community}}</text>
    </revision>
    <revision>
      <id>3584</id>
      <timestamp>2013-02-14T15:37:12Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1525">{{DISPLAYTITLE:Portale della community di Blood Wiki}}
==Piccola guida==
Quando scrivete o modificate le pagine, per favore, seguite queste regole:

* Pubblicate solo informazioni relative a Blood Omnicide (storia, sviluppo, problemi).
* Non pubblicate troppi link a pagine esterne.
* Imparate l'utilizzo della sintassi della Wiki e dei template.
* Create dei link per la terminologia specifica, così potranno esserne creati gli articoli in futuro.
* Non linkate due volte alla stessa pagina.
* [[Special:SpecialPages | Non]] met[[Special:SpecialPages |tete]] trop[[Special:SpecialPages |pi]] link. È [[Special:SpecialPages | brutto]] da [[Special:SpecialPages | vedere]].
* Non fate gli idioti o vi banneremo.

==Template==
* [[:Category:Formatting_templates | Template per la formattazione]]
* [[:Category:Special templates | Template speciali]]
* [[:Category:Page marks | Segnalatori di pagina]]

==Pagine su cui lavorare==
* [[BloodWiki:UnfinishedPages | Pagine non finite]]
* [[BloodWiki:ScreenshotRequiredPages | Pagine che necessitano screenshot]]
* [[:Special:WantedPages | Pagine non elencate]]
* [[BloodWiki:WorkInProgress | Pagine in via di sviluppo]]
* [[BloodWiki:UnmarkedPages | Pagine prive di segnalatore]]

==Portali==
* [[:Category:InRussian|Tutte le pagine nel portale &quot;Blood Wiki in Russian&quot;]]
* [[:Category:InItalian|Tutte le pagine nel portale &quot;Blood Wiki in Italian&quot;]]

==Lista delle pagine richieste==
Aggiungi qui una pagina che vuoi che sia creata.

__NOTOC__
{{initalian|Portale della community}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Cvar</title>
    <ns>0</ns>
    <id>656</id>
      <sha1>a06rkgy275aiyfmzqzcu683gfvuktq9</sha1>
    <revision>
      <id>3649</id>
      <timestamp>2013-06-15T18:34:49Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;Cvar è l'abbreviazione di Console Variable.  Questa variabile è usata in molti videogiochi che possono essere manipolati tramite un'interfaccia a linea di comando basata su ...&quot;</comment>
      <text xml:space="preserve" bytes="418">Cvar è l'abbreviazione di Console Variable.

Questa variabile è usata in molti videogiochi che possono essere manipolati tramite un'interfaccia a linea di comando basata su testo, all'interno del gioco o del motore grafico, chiamata console.

In Blood Omnicide, le cvar sono manipolate dalla console e da QuakeC. La console può essere aperta premendo MAIUSC+ESC.

[[Category:InItalian/Glossario]]
{{initalian|Cvar}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/DDS</title>
    <ns>0</ns>
    <id>649</id>
      <sha1>4so23m5px9n0brxjvasimwo3bpkwbs9</sha1>
    <revision>
      <id>3596</id>
      <timestamp>2013-02-15T21:58:33Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;Il Direct Draw Suface è un formato file sviluppato da Microsoft per l'SDK di DirectX. Questo formato viene usato in molti giochi per contenere [[texture compression | texture...&quot;</comment>
      <text xml:space="preserve" bytes="4361">Il Direct Draw Suface è un formato file sviluppato da Microsoft per l'SDK di DirectX. Questo formato viene usato in molti giochi per contenere [[texture compression | texture compresse]]. 

Il motore grafico Darkplaces può caricare DDS contenenti immagini nei seguenti formati:
* '''BGRA''' : immagine non compressa a 32 bit
* '''DXT1''' : texture DXT1 compressa a 4 bit
* '''DXT2''' : texture DXT2 compressa a 8 bit
* '''DXT3''' : texture DXT3 compressa a 8 bit
* '''DXT4''' : texture DXT4 compressa a 8 bit
* '''DXT5''' : texture DXT5 compressa a 8 bit

Nella Darkplaces DDS non è un formato texture generale come [[Portal:InItalian/TGA|TGA]] o [[JPEG]], ma una texture sostitutiva (dds/filename.dds) che viene caricata al posto di quella di base (filename.tga), se presente. 

Tutti i file DDS vanno messi sotto la cartella dds/, e il resto del percorso dovrebbe imitare quello del file della texture base:

 dds/textures/mausoleum/outerwall1_1 &lt;font color=green&gt;// sostituisce textures/mausoleum/outerwall1_1&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1_norm &lt;font color=green&gt;// sostituisce models/mapobjects/inn/barrel1_1_norm&lt;/font&gt;
 dds/models/mapobjects/inn/barrel1_1 &lt;font color=green&gt;// sostituisce models/mapobjects/inn/barrel1_1&lt;/font&gt;

I file DDS devono avere le MIP map pre-generate. Se non ci sono MIP map già generate viene dato per scontato che quella texture non ne usi nessuna. 

{{importante|l'Engine non dovrebbe provare ad usare MIP map che non esistono nel DDS (vedi [[Darkplaces_material_system/General_Keywords#noMipMaps | noPicMip]], anche le immagini sotto gfx/ non usano mai MIP map) o potrebbe andare in crash.}}

{{bug|Alcuni driver non lavorano con texture compresse non come potenze di due (lasciando un'immagine nera). La cosa migliore è sempre avere texture DDS che siano [[potenze di due]].}}

===DDS per NetRadiant===

Sfortunatamente NetRadiant non carica immagini DDS, usa al loro posto sempre le texture base. Questo diventa un problema quando si dà a Radiant il gioco compilato (che include solo DDS, e non texture base). Per evitare di avere texture mancanti o dei difetti nel pennello tutte le texture del mondo di gioco devono essere applicate a [[brush | pennelli]], devono avere un'immagine a parte solo per Radiant (vedi [[Darkplaces_material_system/Special_Keywords#qer_editorImage_.3CtextureName.3E | qer_editorImage]]).

Per convenzione le immagini solo per Radiant vanno dentro a ''gamedir/radiant/path_to_base_texture'':
 '''textures/town/wall1_1'''
 { 
     &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/town/wall1_1'''
     ...
 }

==Tool==
Si possono usare i seguenti tool per creare immagini DDS compresse:
* [[RwgTex]] - tool a rige di comando raccomandato per Blood Omnicide
* [http://developer.amd.com/tools/compressonator/pages/default.aspx ATI Compressonator]
* [http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp PVRTexTool] (serve la registrazione)

==Alternative future==
Nel 2010 il gruppo Khronos ha presentato il formato [http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ KTX] (che copre i formati texture di OpenGL e OpenGL ES). Questo formato potrà essere usato in futuro in sostituzione al DDS.

==Variabili della console==
{{cvar|r_texture_dds_load|carica il dds/nomefile.dds compresso al posto del nomefile.tga. Se il file esiste (serve il supporto del driver).}}
{{cvar|r_texture_dds_load_alphamode|segnalatore trust DDPF_ALPHAPIXELS, 1: formato della texture e ricerca forzata se ambiguo, 2: solo il formato della texture}}
{{cvar|r_texture_dds_load_logfailure|log texture DDS mancante per ddstexturefailures.log, 0: fai il log, 1: log senza texture opzionali (_norm, glow ecc.). 2: log di tutto}}
{{cvar|r_texture_dds_save|salva la texture compressa dds/nomefile.dds quando nomefile.tga viene caricato, in modo da caricare quella al suo posto in futuro}}
{{cvar|r_texture_dds_swdecode|0: non fare la decodifica software dei DDS, 1: fare decodifica software dei DDS se supportata, 2: sempre fare la decodifica software dei DDS. La decodifica software elimina tutti i vantaggi del DDS e va usata solo se il driver non supporta i DDS o a scopo di debugging.}}

==Vedi anche==
* [[texture compression | Compressione delle texture]]

{{initalian|DDS}}
[[Category:InItalian/Formati_dei_file]]
[[Category:InItalian/Glossario]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/DPSUBS</title>
    <ns>0</ns>
    <id>639</id>
      <sha1>oik8g7cuake0edyuj28zgvitaxzal25</sha1>
    <revision>
      <id>3564</id>
      <timestamp>2013-01-31T14:16:24Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;File di testo usati per aggiungere dei sottotitoli in Darkplaces Cinematics player.  Mentre le proprietà del render dei sottotitoli sono definite nelle [[cvar | variabili del...&quot;</comment>
      <text xml:space="preserve" bytes="849">File di testo usati per aggiungere dei sottotitoli in Darkplaces Cinematics player.

Mentre le proprietà del render dei sottotitoli sono definite nelle [[cvar | variabili della console]], il testo dei sottotitoli sono contenuti nei file .dpsubs.

Ogni riga di un .dpsubs contiene tre elementi separati da uno spazio o da una barra.

# momento di inzio del sottotitolo
# durata del sottotitolo (può essere negativa, e in questo caso il sottotitolo non apparirà finché non inizierà quello seguente).
# testo del sottotitolo

Esempio di file:
 035.5  3.0 &quot;Malek!&quot;
 045.0  3.0 &quot;Malek!&quot;
 071.0  3.0 &quot;Malek!&quot;
 076.5  6.0 &quot;Chiama i cani! Potranno banchettare sui vostri cadaveri!&quot;

I file .dpsubs devono essere codificate come UTF-8 senza BOM (Byte-Order-Mark).

[[Category:InItalian/Formati_dei_file]]
{{initalian|DPSUBS}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Formati dei file di Blood Omen</title>
    <ns>0</ns>
    <id>599</id>
      <sha1>kq2yllhtj376tn0jyzuxl22rxtie38t</sha1>
    <revision>
      <id>3374</id>
      <timestamp>2013-01-20T21:30:21Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{TOCRIGHT}} Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen...&quot;</comment>
      <text xml:space="preserve" bytes="36536">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di voci
 &lt;span style=&quot;color:green&quot;&gt;Array delle voci:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della voce:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Possono esserci degli spazi tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Decodifiche e codifiche di riferimento sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Alcune voci del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono contenere code con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per Playstation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione pc. Decodifiche e codifiche di riferimento sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione pc. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|Files have no header at all}}

===File audio WAV===
Blood Omen per pc ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione pc di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del bottone (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del bottone&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// componente del rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// componente del verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// componente del blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un bottone speciale controlla tutti i bottoni usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i bottoni hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei bottoni&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se si ha questo byte mentre si leggono i dati dell'immagine, dovrebbe leggere 1 byte in più che indica quante volte va ripetuto quel byte. Blood Omen RLE usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3377</id>
      <timestamp>2013-01-21T17:10:22Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="36572">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esseri dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per Playstation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione pc. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione pc. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per pc ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione pc di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3378</id>
      <timestamp>2013-01-21T17:11:10Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="36573">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esseri dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per Playstation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione pc. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione pc. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per pc ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione pc di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3382</id>
      <timestamp>2013-01-21T17:50:59Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="36574">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esserci dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per PlayStation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione PC. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione PC. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per PC ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione PC di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3383</id>
      <timestamp>2013-01-21T17:55:00Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="36742">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Blood Pill|Portal:InItalian/Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esserci dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill|Portal:InItalian/Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per PlayStation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione PC. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Blood Pill|Portal:InItalian/Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione PC. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per PC ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione PC di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Blood Pill|Portal:InItalian/Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Blood Pill|Portal:InItalian/Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Blood Pill|Portal:InItalian/Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3384</id>
      <timestamp>2013-01-21T17:55:54Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="36742">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Portal:InItalian/Blood Pill|Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esserci dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per PlayStation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione PC. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione PC. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per PC ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione PC di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Portal:InItalian/Blood Pill|Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3431</id>
      <timestamp>2013-01-22T15:30:10Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="36741">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Portal:InItalian/Blood Pill|Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esserci dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per PlayStation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione PC. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione PC. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per PC ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione PC di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Portal:InItalian/Blood Pill|Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati di file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
    <revision>
      <id>3509</id>
      <timestamp>2013-01-24T14:14:59Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="36742">{{TOCRIGHT}}
Questa pagina è dedicata alle specifiche per i formati dei file usati in Blood Omen. Include il lavoro di esplorazione fatto dalla community da quando Blood Omen è uscito. 

La maggior parte dei formati semplici (come la struttura del file BIG, le specifiche del TIM) sono stati resi esplorabili anni fa, ma altri (il formato della mappa, gli sprite) soltanto di recente, durante lo sviluppo di [[Portal:InItalian/Blood Pill|Blood Pill]].

==File BIG==
Questo è un file generale che contiene tutte le risorse di gioco. La sua struttura è molto semplice:

 '''uint32''' - numero di entries
 &lt;span style=&quot;color:green&quot;&gt;Array delle entries:&lt;/span&gt;
   '''uint32''' - Nome hash del file
   '''uint32''' - Dimensione del file
   '''uint32''' - Offset del file
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati della entry:&lt;/span&gt;
   '''bytes''' - Contenuti del file

{{tip|Può esserci dello spazio tra i file}}

==Immagine TIM==
Immagini per PlayStation. Usate per contenere gli elementi grafici e i componenti della mappa. Le specifiche dei TIM sono ben conosciute, quindi non verranno elencate qui. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

'''Consigli''':
* Alcune entries del pill.big possono contenere più file TIM fusi insieme.
* Alcuni file TIM di Blood Omen possono terminare con dei null.

==Suoni==

===VAG===
I file &quot;Very-Audio-Good&quot; per PlayStation (variazione ADPCM di 4-bit) usati nella versione PlayStation di Blood Omen e dal preview di gioco. Non sono usati nella versione PC. Riferimenti per decodificare e codificare sono disponibili nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

'''Consigli''':
* Molti file VAG sono senza header (il loro header è confuso, non c'è neppure il fourCC &quot;VAGb&quot;, dunque possono essere individuati solo con un'analisi sintattica).
* Normalmente andrebbero eseguiti a 11025hz, ma alcuni (le musiche e alcuni effetti sonori) a 22050hz.

===IMA ADPCM grezzi===
Dei file senza header che contengono flussi grezzi IMA ADPCM che servono a sostituire i file VAG nella versione PC. Usano esattamente gli stessi nomi dei file VAG per la PlayStation.

{{tip|I file non hanno alcun header}}

===File audio WAV===
Blood Omen per PC ha alcuni effetti sonori in formato WAV (La PlayStation li ha in VAG). Questo formato è largamente conosciuto e non c'è bisogno di spiegarlo.

{{tip|Sembra che il gioco non usi gli header dei WAV; alcuni file hanno un play rate alterato e devono essere aggiustati manualmente per poterli eseguire come si sentono in gioco}}

==Video==

===STR della PSX===
Usato nella versione PlayStation di Blood Omen. L'STR è un flusso video MJPEG con l'audio aggiunto come interleave. Si può usare il tool [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec] per estrarre e decodificare questo formato dall'immagine del cd per PlayStation del gioco.

===Video JAM===
JAM è un formato di compressione video scadente sviluppato da Semilogic Entertainment e usato nella versione PC di Blood Omen. Il formato usa una tavolozza in comune con più frame e un tipo di compressione dinamica. La specifica e la decodifica dei JAM sono state scoperte nel 2011 da MisterGrim. Il JAM può solo contenere video, l'audio era contenuto in un file VAG separato (che era, in effetti, un IMA ADPCM grezzo).

I video JAM hanno molte più alterazioni dei STR, e la traccia audio è in mono (gli STR hanno una stereo).

Il codice per decomprimere i JAM è disponibile nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

==Gli sprite==

Gli sprite sono immagini di personaggi o altre cose animate. Ci sono tre estensioni e altrettanti nomi dei file: SHA, SDR, SHD. Tuttavia quando Blood Pill è stato sviluppato non erano noti i veri nomi dei file, quindi questa specifica viene definita &quot;Tipi di sprite&quot; e copre la decompressione di tutti gli sprite, inclusi quelli non utilizzati.

===Sprite di tipo 1 - Carte degli oggetti===
Ha sempre 1 frame e nessuna compressione. 

 '''uint32''' - sempre 0x01 0x00 0x00 0x00 
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (256 colori)
 '''int16''' - posizione su x
 '''int16''' - posizione su y
 '''byte''' - larghezza
 '''byte''' - altezza
 '''byte''' - x
 '''byte''' - y
 '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In realtà è una versione semplificata dello sprite di tipo 3}}

===Sprite di tipo 2 - Insieme di immagini===
Sprite a più frame con tavolozza dedicata ad ogni frame. Usato per le raccolte di immagini dell'interfaccia (come le immagini degli incantesimi e degli oggetti).

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit (inutilizzato)
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''768 bytes''' - dati della mappa dei colri a 24 bit
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''larghezza*altezza bytes''' - contenuto dell'immagine (gli indici nella mappa dei colori)

{{tip|In alcuni file la larghezza e l'altezza reali potrebbero essere doppie di quelle scritte nell'header}}

===Sprite di tipo 3 - Sprite degli oggetti===
Sprite a più frame con tavolozza condivisa.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 4 - Sprite dei personaggi===
Sprite a più frame con tavolozza condivisa, con header dei frame aggiuntivi. Usato dai personaggi. Molto simile al tipo 3.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 &lt;span style=&quot;color:green&quot;&gt;Array degli header aggiuntivi del frame (arrotondati per eccesso al multiplo di 4 più vicino):&lt;/span&gt;
    '''byte''' - informazioni ignote
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 '''int16''' - offset in x per tutti i frame
 '''int16''' - offset in y per tutti i frame
 &lt;span style=&quot;color:green&quot;&gt;Array dehli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) usando un run-length encoding; alcuni file usando colori a 4 bit (vedi [[#Metodi di compressione]])

'''Consigli''':
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato
* Alcuni file usano colori a 4 bit invece che RLE

===Sprite di tipo 5===
Un'altra variante del tipo 3 senza informazioni sull'offset e (a volte) con larghezza e altezza non valide, da mettere a posto con un particolare trucco.

 '''uint32''' - numero di frame
 '''uint32''' - dimensione del file
 '''768 bytes''' - dati della mappa dei colori a 24 bit
 &lt;span style=&quot;color:green&quot;&gt;Array degli header del frame:&lt;/span&gt;
   '''uint32''' - offset dei dati dell'immagine dalla fine degli header
   '''ubyte''' - larghezza
   '''ubyte''' - altezza
   '''byte''' - x
   '''byte''' - y
 &lt;span style=&quot;color:green&quot;&gt;Array dei dati dell'immagine del frame:&lt;/span&gt;
   '''bytes''' - contenuti dell'immagine compressa (gli indici nella mappa dei colori) che usano RLE  (vedi [[#Metodi di compressione]])

'''Consigli''':
* Alcuni frame hanno larghezza e altezza non valide perché la loro larghezza è maggiore di 255 e il formato usa 1 bit per codificarle. Per correggere il problema va usato 255 + [larghezza]
* Non si sa come scoprire quale compressione del file sia usata (RLE a 0x00, o 0xFF o entrambe), sembra che l'engine dia questa informazione quando il file viene caricato

==Mappe==

Le mappe sono un elemento centrale che mette insieme tutte le risorse (immagini, suoni, mattonelle, sprite). Circa l'80% della struttura della mappa è stata scoperta e questo permette di estrarre una serie di cose, incluse: le texture usate, l'immagine della mappa, posizione di mostri/effetti/oggetti, attivatori, informazioni scritte, porte e bottoni...

Ogni mappa ha un mapnum (numero della mappa) e una sezione inclusa nel nome del file. Quell'informazione viene usata per piazzare la mappa nella mappa globale di un'avventura (vedi [http://www.thelostworlds.net/BO1/Map_Survey.html TheLost Worlds - May survey] per le informazioni complete sui nomi dei livelli).

=== Mattonelle ===
Le mattonelle sono immagini TIM a 256 colori compresse con LZ77 (vedi [[#Metodi di compressione]]).

La texture di ogni mattonella ha 8x8=64 mattonelle. L'engine renderizza ogni mattonella separatmaente, spostando la texture della mattonella del momento come necessario.

 '''uint32''' - dimensione dei dati compressi
 '''bytes''' - dati compressi

'''Consigli''':
* Dato che tutte le mattonelle sono dei TIM a 8 bit 256x256, la dimensione dei dati decompressi è sempre la stessa

=== File della mappa ===

Il file della mappa è una struttura di lunghezza fissa che contiene la posizione delle mattonelle (80x80), i nemici, le luci, i botoni e altri oggetti che compongono il livellod i Blood Omen. Per via della sua natura statica ha molti limiti, e ogni mappa ha esattamente la stessa dimensione (quindi basta copiarla in memoria).

 &lt;span style=&quot;color:green&quot;&gt;// map trigger&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt; 
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' parm1;    &lt;span style=&quot;color:green&quot;&gt;// primo parm, se non definito lo script è 0xFFFF, 0xFFFE è il valore null&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero di mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del discorso (TRIGGER_INFOMARK, TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''unsigned short''' parm2;    &lt;span style=&quot;color:green&quot;&gt;// secondo parm:&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero del pulsante (TRIGGER_BUTTON)&lt;/span&gt;
                               &lt;span style=&quot;color:green&quot;&gt;//  - numero dell'immagine (TRIGGER_IMAGEMARK)&lt;/span&gt;
      '''byte'''           parm3;    &lt;span style=&quot;color:green&quot;&gt;// sezione della mappa di destinazione/origine (TRIGGER_EXIT, TRIGGER_ENTRANCE, TRIGGER_TELEPORT)&lt;/span&gt;
      '''byte'''           srcx;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           srcy;     &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           type;     &lt;span style=&quot;color:green&quot;&gt;// tipo di script, uno dei TRIGGER_&lt;/span&gt;
      '''byte'''           u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;    &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_trigger_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// oggetto della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte'''           itemcode; &lt;span style=&quot;color:green&quot;&gt;// uno dei codici MAPITEM_&lt;/span&gt;
      '''byte'''           x;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           y;        &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte'''           hidden;   &lt;span style=&quot;color:green&quot;&gt;// vale 1 se l'oggetto viene spawnato da un attivatore (come la distruzione di un barile)&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori bersaglio&lt;/span&gt;
      '''byte'''           u&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;     &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_item_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// mattonella animata&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' contents1;          &lt;span style=&quot;color:green&quot;&gt;// contenuti, vedi le definizioni di CONTENTS_ per i possibili valori dei contenuti&lt;/span&gt;
      '''byte''' contents2;          &lt;span style=&quot;color:green&quot;&gt;// contenuti allo stato alternativo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_atile_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// controller del pulsante&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// un gruppo di attivatori da chiamare&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// numero della mattonella allo stato alternativo&lt;/span&gt;
      '''byte''' flags;              &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei BUTTONFLAG_*&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_button_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// effetto&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' lightposx;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' lightposy;          &lt;span style=&quot;color:green&quot;&gt;// posizione della fonte di luce&lt;/span&gt;
      '''byte''' sprite;             &lt;span style=&quot;color:green&quot;&gt;// indice dello sprite dall'array degli sprite&lt;/span&gt;
      '''byte''' lightsizex;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' lightsizey;         &lt;span style=&quot;color:green&quot;&gt;// dimensione dei poligoni di luce&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lightform;          &lt;span style=&quot;color:green&quot;&gt;// flag della forma della luce&lt;/span&gt;
      '''byte''' r;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di rosso&lt;/span&gt;
      '''byte''' g;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di verde&lt;/span&gt;
      '''byte''' b;                  &lt;span style=&quot;color:green&quot;&gt;// quantità di blu&lt;/span&gt;
      '''unsigned short''' targetnum;&lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori&lt;/span&gt;
      '''byte''' start_on;           &lt;span style=&quot;color:green&quot;&gt;// 1 se l'effetto parte attivo, 0 se parte disattivo&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;5&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_effect_t''';
 
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' data&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;164&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_object_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// definizione dell'oggetto sulla mattonella (barili, forzieri)&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione iniziale&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione finale&lt;/span&gt;
      '''byte''' w;                  &lt;span style=&quot;color:green&quot;&gt;// larghezza&lt;/span&gt;
      '''byte''' h;                  &lt;span style=&quot;color:green&quot;&gt;// altezza&lt;/span&gt;
      '''byte''' ofsx;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' ofsy;               &lt;span style=&quot;color:green&quot;&gt;// moltiplica per 16 per il vero offset&lt;/span&gt;
      '''byte''' u1;
      '''byte''' u2;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_grpobject_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità dello scenario&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u3;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u4;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' tile1;    &lt;span style=&quot;color:green&quot;&gt;// mattonella base (in realtà l'oggetto gruppo, non la mattonella 32x32 standard&lt;/span&gt;
      '''unsigned short''' tile2;    &lt;span style=&quot;color:green&quot;&gt;// mattonella alternativa (oggetto gruppo)&lt;/span&gt;
      '''unsigned short''' tile3;    &lt;span style=&quot;color:green&quot;&gt;// mattonella distrutta (oggetto gruppo)&lt;/span&gt;
      '''byte''' u5;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' pushable;           &lt;span style=&quot;color:green&quot;&gt;// una forza necessaria per spingere&lt;/span&gt;
      '''byte''' toggled;            &lt;span style=&quot;color:green&quot;&gt;// l'attivatore che cambia lo stato (significa che c'è la mattonella 2)&lt;/span&gt;
      '''byte''' u7;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' spawnitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;3&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// codici dell'oggetto da spawnare quando attivato/distrutto&lt;/span&gt;
      '''byte''' u8;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' destructible;       &lt;span style=&quot;color:green&quot;&gt;// i flag distruggibili&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u10;                &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u11;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
      '''byte''' active;             &lt;span style=&quot;color:green&quot;&gt;// 1 è pieno, altrimenti 0&lt;/span&gt;
      '''byte''' u13;                &lt;span style=&quot;color:green&quot;&gt;// ? &lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_scenery_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// tracciati dei nemici&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u1;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u2;                 &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_path_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// entità nemica&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      bo_path_t paths&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;      &lt;span style=&quot;color:green&quot;&gt;// tracciati di pattugliamento&lt;/span&gt;
      '''byte''' u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' savenum;  &lt;span style=&quot;color:green&quot;&gt;// id unico di salvataggio&lt;/span&gt;
      '''byte''' u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;52&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' charnum;            &lt;span style=&quot;color:green&quot;&gt;// classe del mostro (come per lo sprite del personaggio)&lt;/span&gt;
      '''byte''' u3&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' target;   &lt;span style=&quot;color:green&quot;&gt;// gruppo di attivatori da chiamare quando viene ucciso&lt;/span&gt;
      '''byte''' u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' lastpath;           &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;18&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;15&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;             &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''byte''' x;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' y;                  &lt;span style=&quot;color:green&quot;&gt;// posizione&lt;/span&gt;
      '''byte''' u8&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
      '''unsigned short''' speechnum;&lt;span style=&quot;color:green&quot;&gt;// un numero di parlato per i discorsi del travestimento&lt;/span&gt;
      '''byte''' u9&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;6&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;              &lt;span style=&quot;color:green&quot;&gt;// ?&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;'''bo_monster_t''';
 
 &lt;span style=&quot;color:green&quot;&gt;// struttura generale del file della mappa&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;typedef struct&lt;/span&gt;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''{'''&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// una catena di numeri della mappa delle mattonelle usati (per creare i nomi dei file)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// ogni mappa delle mattonelle contiene 64 mattonelle, i cui numeri sono lineari&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// per esempio, una mattonella #131 è la mattonella #3 dalla mappa delle mattonelle #2&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// con flag da 2-'''byte''' ('''abbreviazione senza firma''') contenuti nel numero della mattonella (i flag cominciano dal '''byte''' 10)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei TILEFLAG_ per i possibili flag delle mattonelle&lt;/span&gt;
      '''unsigned short'''  tilemaps&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione ancora ignota&lt;/span&gt;
      '''byte'''            u1&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;12&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_object_t'''     objects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;10&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_monster_t'''    monsters&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_grpobject_t'''  grpobjects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;32&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mattonelle animate - una mattonella che può essere in 2 stati e che ha contenuti diversi ad ogni stato&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// usato per le porte, le punte che escono dal terreno ecc.&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// le mattonelle animate hanno un gruppo di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_atile_t'''      atiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;100&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// l'array di un pulsante speciale controlla tutti i pulsanti usati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// molto simile alle mattonelle animate&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i pulsanti hanno gruppi di attivatori da eseguire con degli script&lt;/span&gt;
      '''bo_button_t'''     buttons&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;20&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// informazione #2 ancora ignota&lt;/span&gt;
      '''byte'''            u2&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti spingibili nella scena - tavoli, sedie, pietre ecc.&lt;/span&gt;
      '''bo_scenery_t'''    scenery&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;256&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// prima mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  backtiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// seconda mappa delle mattonelle&lt;/span&gt;
      '''unsigned short'''  foretiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// mappa dei contenuti - un valore di contenuto per ogni mattonella statica (in gioco vengono sostituite dalle mattonelle modificabili, se presenti)&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// vedi le definizioni dei CONTENTS_  per i possibili valori dei contenuti&lt;/span&gt;
      '''byte'''            contents&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// linear triggers array - all triggers used on map&lt;/span&gt;
      '''bo_trigger_t'''    triggers&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;255&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// triggers are non-solid interaction points, activated when player stands in them&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// this array golds pointers to triggers&lt;/span&gt;
      '''byte'''            triggertiles&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;80&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// oggetti piazzati nel livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// i codici degli oggetti 0-9 sono potenziamenti, i codici 10, 11, 12, 13 sono riservati per i codici di oggetti unici&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;// quindi non possono esserci più di 4 tipi di oggetti unici in ogni livello&lt;/span&gt;
      &lt;span style=&quot;color:green&quot;&gt;//sono oggetti unici: incantesimi, armi, forme, artefatti, oggetti delle missioni&lt;/span&gt;
      '''byte'''            uniqueitems&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;4&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_item_t'''       items&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;50&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''            u4&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u5&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;40&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''byte'''            u6&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;24&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// effetti&lt;/span&gt;
      '''unsigned short'''  sprites&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;8&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      '''bo_effect_t'''     effects&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;64&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
      &lt;span style=&quot;color:green&quot;&gt;// dati ancora sconosciuti&lt;/span&gt;
      '''byte'''   u7&lt;span style=&quot;color:darkblue&quot;&gt;'''['''&lt;/span&gt;936&lt;span style=&quot;color:darkblue&quot;&gt;''']'''&lt;/span&gt;;
 &lt;span style=&quot;color:darkblue&quot;&gt;'''}'''&lt;/span&gt;bo_map_t;
 
 &lt;span style=&quot;color:green&quot;&gt;// cose ancora non capite:&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - come funziona l'illuminazione (luci di vario tipo, luce di notte e giorno, luce ambientale)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - gli interruttori dei tracciati dei mostri (alcuni tracciati sono incasinati)&lt;/span&gt;
 &lt;span style=&quot;color:green&quot;&gt;// - counter e attivatori dei puzzle?&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// flag delle mattonelle&lt;/span&gt;
 #define '''TILEFLAG_UNKNOWN1'''       1024
 #define '''TILEFLAG_NODRAW'''         2048
 #define '''TILEFLAG_UNKNOWN3'''       4096
 #define '''TILEFLAG_UNKNOWN4'''       8192
 #define '''TILEFLAG_ALWAYSONTOP'''    16384
 #define '''TILEFLAG_UNKNOWN6'''       32768
 
 &lt;span style=&quot;color:green&quot;&gt;// contenuti&lt;/span&gt;
 #define '''CONTENTS_SOLID'''          1
 #define '''CONTENTS_WATER'''          2
 #define '''CONTENTS_LAVA'''           3
 #define '''CONTENTS_FIRE'''           4
 #define '''CONTENTS_SPIKES'''         5
 #define '''CONTENTS_TRAPTELEPORT'''   6
 #define '''CONTENTS_JUMPWALL'''       8
 #define '''CONTENTS_SWAMP'''          11
 #define '''CONTENTS_JUMPFENCE'''      10
 #define '''CONTENTS_MISTWALK'''       12
 #define '''CONTENTS_SACRIFICE'''      13
 #define '''CONTENTS_ICE'''            19
 #define '''CONTENTS_SAVEGAM'''        44
 #define '''CONTENTS_BATMARK'''        45
 
 &lt;span style=&quot;color:green&quot;&gt;// attivatori&lt;/span&gt;
 #define '''TRIGGER_EXIT'''            1
 #define '''TRIGGER_ENTRANCE'''        2
 #define '''TRIGGER_SPEECHMARK'''      3
 #define '''TRIGGER_TOUCH'''           4
 #define '''TRIGGER_TELEPORT'''        6
 #define '''TRIGGER_IMAGEMARK'''       7
 
 &lt;span style=&quot;color:green&quot;&gt;// flag dei pulsanti&lt;/span&gt;
 #define '''BUTTONFLAG_TOGGLE'''       1
 #define '''BUTTONFLAG_SECRET'''       2
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti&lt;/span&gt;
 #define '''MAPITEM_SMALLBLOODFLASK''' 1
 #define '''MAPITEM_BLOODFLASK'''      2
 #define '''MAPITEM_RUNEPYRAMID'''     3
 #define '''MAPITEM_PURPLESPHERE'''    4
 #define '''MAPITEM_BLUESPHERE'''      5
 #define '''MAPITEM_GREENSPHERE'''     6
 #define '''MAPITEM_GOLDSPHERE'''      7
 #define '''MAPITEM_REDSPHERE'''       8
 #define '''MAPITEM_ANCIENTVIAL'''     9
 #define '''MAPITEM_UNIQUE1'''         10 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE2'''         11 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE3'''         12 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 #define '''MAPITEM_UNIQUE4'''         13 &lt;span style=&quot;color:green&quot;&gt;// codici di oggetti unici&lt;/span&gt;
 
 &lt;span style=&quot;color:green&quot;&gt;// codici degli oggetti unici&lt;/span&gt;
 #define '''ITEM_SPELL_INSPIREHATE'''  10
 #define '''ITEM_SPELL_STUN'''         11
 #define '''ITEM_SPELL_SPIRITWRACK'''  12
 #define '''ITEM_SPELL_BLOODGOUT'''    13
 #define '''ITEM_SPELL_BLOODSHOWER'''  14
 #define '''ITEM_SPELL_SPIRITDEATH'''  15
 #define '''ITEM_SPELL_LIGHT'''        16
 #define '''ITEM_SPELL_LIGHTNING'''    17
 #define '''ITEM_SPELL_REPEL'''        18
 #define '''ITEM_SPELL_ENERGYBOLT'''   19
 #define '''ITEM_SPELL_INCAPACITATE''' 20
 #define '''ITEM_SPELL_CONTROLMIND'''  21
 #define '''ITEM_SPELL_SANCTUARY'''    22
 #define '''ITEM_ARTIFACT_FLAY'''      23
 #define '''ITEM_ARTIFACT_PENTALICH''' 24
 #define '''ITEM_ARTIFACT_IMPLODE'''   25
 #define '''ITEM_ARTIFACT_FONT'''      26
 #define '''ITEM_ARTIFACT_BANK'''      27
 #define '''ITEM_ARTIFACT_HEART'''     28
 #define '''ITEM_ARTIFACT_ANTITOXIN''' 29
 #define '''ITEM_ARTIFACT_SLOWTIME'''  30
 #define '''ITEM_TOKEN_MOEBIUS'''      31
 #define '''ITEM_TOKEN_DEJOULE'''      32
 #define '''ITEM_TOKEN_DOLL'''         33
 #define '''ITEM_TOKEN_MALEK'''        34
 #define '''ITEM_TOKEN_AZIMUTH'''      35
 #define '''ITEM_TOKEN_MORTANIUS'''    36
 #define '''ITEM_TOKEN_NUPRAPTOR'''    37
 #define '''ITEM_TOKEN_BANE'''         38
 #define '''ITEM_TOKEN_SIGNETRING'''   39
 #define '''ITEM_TOKEN_TIMEDEVICE'''   40
 #define '''ITEM_TOKEN_ANACROTHE'''    41
 #define '''ITEM_WEAPON_MACE'''        43
 #define '''ITEM_WEAPON_AXES'''        44
 #define '''ITEM_WEAPON_FLAMESWORD'''  45
 #define '''ITEM_WEAPON_SOULREAVER'''  46
 #define '''ITEM_ARMOR_BONE'''         48
 #define '''ITEM_ARMOR_CHAOS'''        49
 #define '''ITEM_ARMOR_FLESH'''        50
 #define '''ITEM_ARMOR_WRAITH'''       51
 #define '''ITEM_FORM_BAT'''           53
 #define '''ITEM_FORM_WOLF'''          54
 #define '''ITEM_FORM_DISGUISE'''      55
 #define '''ITEM_FORM_MIST'''          56
 #define '''ITEM_ENDING_1'''           69
 #define '''ITEM_ENDING_2'''           70

==Metodi di compressione==

''' Run Length Encoding (RLE) basato sull'indice'''

Usato sui dati degli sprite per comprimere le zone nere che normalmente sono trasparenti. Questa tecnica altera il processo di lettura dei byte 0x0 e 0xFF. Se durante la lettura dei dati dell'immagine si ottiene questo byte, si dovrà leggere un byte in più che conterrà il numero di volte che quel byte va ripetuto. Blood Omen RLE è usato solo per valori di 0x00 o 0xFF.
    
Esempio: 

 &lt;span style=&quot;color:green&quot;&gt;// output di 32 byte col valore 0xFF&lt;/span&gt;
 0xFF 0x20

'''Immagini a 4 bit'''

Codifica 2 pixel per ogni byte con una tavolozza da 256 colori ma con solo 16 colori usati (gli altri pixel sono neri).

Per ogni byte produce 2 byte, in ordine:
* byte 1: &lt;byte&gt; - (int)(&lt;byte&gt;/16)*16; &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; mod 16&lt;/span&gt;
* byte 2: (int)(&lt;byte&gt;/16) &lt;span style=&quot;color:green&quot;&gt;// &lt;byte&gt; div 16&lt;/span&gt;
  
Esempio:

  231 manderà in output 2 pixel coi valori:
  byte 1: 7
  byte 2: 14

'''Variazione del LZ77'''

Una variazione degli algoritmi di compressione dei dati del LZ77 (LZ1).

Un decodificatore campione è disponibile a [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html The Lost Worlds] e nel codice sorgente di [[Portal:InItalian/Blood Pill|Blood Pill]].

==Ringraziamenti==
* Andrey [Rackot] Grachev - specifiche del file BIG
* Pavel [VorteX] Timofeyev - file della mappa, sprite
* Ben Lincoln - decompressore LZ77
* Specifiche di decodifica JAM di MisterGrim
* Balder e Zench dai forum di XentaX (www.xentax.com) - IMA ADPCM

==Vedere anche==
* [[Portal:InItalian/Blood Pill|Blood Pill]]
* [http://kenai.com/projects/jpsxdec/pages/Home jPsxDec homepage]
* [http://wiki.qhimm.com/PSX/TIM_file TIM specifications at QHimmWiki]
* [http://www.thelostworlds.net/Software/Blood_Omen_Decompressor.html Blood Omen Decompressor homepage]
* [http://www.thelostworlds.net/BO1/Map_Survey.html Blood Omen Map Survey (TheLostWorlds)]


{{initalian|Formati dei file di Blood Omen}}
__NOEDITSECTION__ 
{{finished}}
{{grammar}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN</title>
    <ns>0</ns>
    <id>602</id>
      <sha1>jatrj6n38wt7dt5vu2qv866axq802b5</sha1>
    <revision>
      <id>3398</id>
      <timestamp>2013-01-22T12:34:52Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{grammar checked|darth}} Questa guida spiega la struttura del repositorio di SVN usato per Blood Omnicide.  ==Capitoli== &lt;font size=3&gt; # [[Portal:InItalian/Guida al repositor...&quot;</comment>
      <text xml:space="preserve" bytes="820">{{grammar checked|darth}}
Questa guida spiega la struttura del repositorio di SVN usato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Portal:InItalian/Guida al repositorio di SVN/Introduzione|Introduzione]]
# [[Portal:InItalian/Guida al repositorio di SVN/Concetti chiave|Concetti chiave]]
# [[Portal:InItalian/Guida al repositorio di SVN/Costruzione del gioco|Costruzione del gioco]]
# [[Portal:InItalian/Guida al repositorio di SVN/Convenzioni per i nomi|Convenzioni per i nomi]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN/Struttura del repositorio nel dettaglio|Struttura del repositorio nel dettaglio]]
* [[Portal:InItalian/Guida al repositorio di SVN/Script per l'automazione|Script per l'automazione]]
&lt;/font&gt;

{{initalian|Guida al reporitorio di SVN}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3401</id>
      <timestamp>2013-01-22T13:33:35Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="808">{{grammar checked|darth}}
Questa guida spiega la struttura del repositorio di SVN usato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Portal:InItalian/Guida al repositorio di SVN/Introduzione|Introduzione]]
# [[Portal:InItalian/Guida al repositorio di SVN/Concetti chiave|Concetti chiave]]
# [[Portal:InItalian/Guida al repositorio di SVN/Build del gioco|Build del gioco]]
# [[Portal:InItalian/Guida al repositorio di SVN/Convenzioni per i nomi|Convenzioni per i nomi]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN/Struttura del repositorio nel dettaglio|Struttura del repositorio nel dettaglio]]
* [[Portal:InItalian/Guida al repositorio di SVN/Script per l'automazione|Script per l'automazione]]
&lt;/font&gt;

{{initalian|Guida al reporitorio di SVN}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3407</id>
      <timestamp>2013-01-22T14:10:55Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="808">{{grammar checked|darth}}
Questa guida spiega la struttura del repositorio di SVN usato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Portal:InItalian/Guida al repositorio di SVN/Introduzione|Introduzione]]
# [[Portal:InItalian/Guida al repositorio di SVN/Concetti chiave|Concetti chiave]]
# [[Portal:InItalian/Guida al repositorio di SVN/Build del gioco|Build del gioco]]
# [[Portal:InItalian/Guida al repositorio di SVN/Convenzioni per i nomi|Convenzioni per i nomi]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN/Struttura del repositorio nel dettaglio|Struttura del repositorio nel dettaglio]]
* [[Portal:InItalian/Guida al repositorio di SVN/Script per l'automazione|Script per l'automazione]]
&lt;/font&gt;

{{initalian|Guida al repositorio di SVN}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3502</id>
      <timestamp>2013-01-24T13:58:06Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="822">{{grammar checked|darth}}
Questa guida spiega la struttura del repositorio di SVN usato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Portal:InItalian/Guida al repositorio di SVN/Introduzione|Introduzione]]
# [[Portal:InItalian/Guida al repositorio di SVN/Concetti chiave|Concetti chiave]]
# [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco|Compilazione del gioco]]
# [[Portal:InItalian/Guida al repositorio di SVN/Convenzioni per i nomi|Convenzioni per i nomi]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Portal:InItalian/Guida al repositorio di SVN/Struttura del repositorio nel dettaglio|Struttura del repositorio nel dettaglio]]
* [[Portal:InItalian/Guida al repositorio di SVN/Script per l'automazione|Script per l'automazione]]
&lt;/font&gt;

{{initalian|Guida al repositorio di SVN}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Build del gioco</title>
    <ns>0</ns>
    <id>625</id>
    <redirect title="Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco" />
      <sha1>0fv66d0q9t5ktspbdxwsbzj1v5vlecf</sha1>
    <revision>
      <id>3506</id>
      <timestamp>2013-01-24T14:06:20Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Makenor13 moved page [[Portal:InItalian/Guida al repositorio di SVN/Build del gioco]] to [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco]]: Fixing link</comment>
      <text xml:space="preserve" bytes="81">#REDIRECT [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco]]</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco</title>
    <ns>0</ns>
    <id>605</id>
      <sha1>h34xk5kzu1c15lfw0kwbcotku658gk1</sha1>
    <revision>
      <id>3405</id>
      <timestamp>2013-01-22T14:05:42Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Concetti chiave}}  ==Installazione di prova== L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella...&quot;</comment>
      <text xml:space="preserve" bytes="3348">{{navigation title|Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L?installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{important|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{important|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{important|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{tip|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{navigation footer|Convenzioni per i nomi}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3406</id>
      <timestamp>2013-01-22T14:06:00Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Installazione di prova */</comment>
      <text xml:space="preserve" bytes="3348">{{navigation title|Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L'installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{important|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{important|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{important|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{tip|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{navigation footer|Convenzioni per i nomi}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3412</id>
      <timestamp>2013-01-22T14:22:45Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3404">{{navigation title|Guida al repositorio di SVN/Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L'installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{important|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{important|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{important|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{tip|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{navigation footer|Guida al repositorio di SVN/Convenzioni per i nomi}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3470</id>
      <timestamp>2013-01-22T19:12:06Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3386">{{capitolo precedente|Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L'installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{importante|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{importante|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{importante|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{tip|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{capitolo successivo|Convenzioni per i nomi}}
{{finished}}
{{initalian|Build del gioco}}</text>
    </revision>
    <revision>
      <id>3487</id>
      <timestamp>2013-01-22T20:04:59Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* Cache DDS per le texture */</comment>
      <text xml:space="preserve" bytes="3392">{{capitolo precedente|Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L'installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{importante|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{importante|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{importante|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{consiglio|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{capitolo successivo|Convenzioni per i nomi}}
{{finished}}
{{initalian|Build del gioco}}</text>
    </revision>
    <revision>
      <id>3501</id>
      <timestamp>2013-01-24T13:57:50Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="3399">{{capitolo precedente|Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L'installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{importante|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{importante|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{importante|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{consiglio|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{capitolo successivo|Convenzioni per i nomi}}
{{finished}}
{{initalian|Compilazione del gioco}}</text>
    </revision>
    <revision>
      <id>3505</id>
      <timestamp>2013-01-24T14:06:20Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <minor/>
      <comment>Makenor13 moved page [[Portal:InItalian/Guida al repositorio di SVN/Build del gioco]] to [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco]]: Fixing link</comment>
      <text xml:space="preserve" bytes="3399">{{capitolo precedente|Concetti chiave}}

==Installazione di prova==
L'installazione di prova serve a trasformare la copia scaricata del repositorio in un gioco funzionante (nella versione per lo sviluppo). L'installazione di prova fa esattamente le stesse cose che fa una vera installazione di Blood Omnicide. Per ogni versione del gioco (PC, PlayStation, demo) la procedura di installazione è leggermente diversa.

&lt;h4&gt;1.Blood Omen versione PC&lt;/h4&gt;
# copiare il '''pill.big''' e tutti i file '''.jam'''/'''.vag''' dentro a '''kain_make/installscript/kain/'''. Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript.cmd'''.
&lt;h4&gt;2. Blood Omen per PlayStation&lt;/h4&gt;
# procurarsi un'immagine del cd di Blood Omen in formato BIN/MDF/ISO/IMG e copiarla dentro a '''kain_make/installscript/kain_psx/kain.bin''' (o kain.mdf, kain.iso, kain.img). Se la cartella non esiste, crearla.
# lanciare '''kain_make/installscript/run_installationscript_psx.cmd'''.
:{{importante|Per una gestione ottimale dei file dell'immagine del cd anche tutti i file degli attributi creati con il file d'immagine (.ccd, .cue, .sub, .mds) dovrebbero essere presenti.}}
:{{importante|Sono supportate solo le immagini di dischi validi. Esistono alcune traduzioni fatte dagli utenti che potrebbero funzionare con un emulatore PSX, ma non con questo script di installazione.}}
&lt;h4&gt;3. Blood Omen per PlayStation (custom)&lt;/h4&gt;
Questo script di installazione è presente solo come ultima spiaggia nel caso si stia usando un'immagine del cd alterata (che non si è installata con lo script generico). Non supporta le cinematiche.
# montare l'immagine con Alcohol 52%, Daemon Tools o un altro programma simile.
# copiare  '''kain/pill.big''' dentro a '''kain_make/installscript/kain_psx/pill.big'''.
# lanciare '''kain_make/installscript/run_installationscript_psx_custom.cmd'''.
&lt;h4&gt;4. Blood Omen demo&lt;/h4&gt;
# lanciare '''kain_make/installscript/run_installationscript_demo.cmd'''.

==Aggiornamenti==
Lanciare il comando '''svn update''' frequentemente per scaricare tutte le ultime modifiche fatte sul repositorio dagli altri utenti.

Alcuni update apportano modifiche alla struttura dei file (aggiungendo nuovi mostri, rinominando file...). In questo caso è necessario lanciare nuovamente la '''test installation'''. Controlla il registro per vedere se è consigliato di lanciare nuovamente lo script di installazione.

==Cache DDS per le texture==
La versioe release del gioco contiene tutte le texture compresse in formato DDS. La cache DDS aiuta a far risparmiare spazio sull'HDD e ad abbassare i requisiti della VRAM.

Blood Omnicide con texture a 32 bit ha bisogno di una scheda video con 1GB di RAM video, mentre con le texture compresse bastano 256MB.

Per compilare la cache DDS di tutte le texture lanciare '''kain_make/makedds/makedds_textures.bat'''.

{{importante|Una volta usata la cache DDS l'engine salterà TUTTE le texture [[TGA]], quindi se si stanno testando delle modifiche di quelle o si è aggiornato da SVN assicurarsi di eliminare '''kain/PILL500.PK3''' (un file contenente la cache DDS prodotta) o di ricompilarlo.}}
{{consiglio|Impostare il CVaR '''r_texture_dds_load''' su 0 disabiliterà la cache DDS per tutto tranne che per gli oggetti che contengono degli sprite.}}

{{capitolo successivo|Convenzioni per i nomi}}
{{finished}}
{{initalian|Compilazione del gioco}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Concetti chiave</title>
    <ns>0</ns>
    <id>604</id>
      <sha1>18c2jfycy52redkqnpnigexujhsr94f</sha1>
    <revision>
      <id>3400</id>
      <timestamp>2013-01-22T13:32:21Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Introduzione}}  ==Differenze tra sviluppo e release== La release di Blood Omnicide è diversa da quella contenuta nel repositorio.   Nella versione per lo s...&quot;</comment>
      <text xml:space="preserve" bytes="2700">{{navigation title|Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800Mb e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{navigation footer|Costruzione del gioco}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3403</id>
      <timestamp>2013-01-22T13:34:37Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="2694">{{navigation title|Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800Mb e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{navigation footer|Build del gioco}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3410</id>
      <timestamp>2013-01-22T14:19:26Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2724">{{navigation title|Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800Mb e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{initalian|Concetti chiave}}
{{navigation footer|Build del gioco}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3413</id>
      <timestamp>2013-01-22T14:22:50Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2750">{{navigation title|Guida al repositorio di SVN/Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800Mb e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{navigation footer|Guida al repositorio di SVN/Build del gioco}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3416</id>
      <timestamp>2013-01-22T14:26:05Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2751">{{navigation title|Guida al repositorio di SVN/Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800 MB e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{navigation footer|Guida al repositorio di SVN/Build del gioco}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3469</id>
      <timestamp>2013-01-22T19:12:04Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2730">{{capitolo precedente|Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800 MB e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{capitolo successivo|Build del gioco}}
{{finished}}
{{initalian|Concetti chiave}}</text>
    </revision>
    <revision>
      <id>3503</id>
      <timestamp>2013-01-24T13:58:56Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Convenzioni */</comment>
      <text xml:space="preserve" bytes="2737">{{capitolo precedente|Introduzione}}

==Differenze tra sviluppo e release==
La release di Blood Omnicide è diversa da quella contenuta nel repositorio. 

Nella versione per lo sviluppo:
* Tutti i file sono file reali (a parte quelli per le installazioni di prova)
* Tutte le texture non sono compresse e la cache DDS è opzionale
* I file con sorgenti e sviluppo sono presenti
* Sono presenti l'SDK e i tool

Nella versione per la release:
* Tutti i file sono compressi in archivi
* Le texture sono compresse (solo con cache DDS)
* I file sorgenti e di sviluppo non sono presenti
* L'SDK ha un download separato

La versione release del gioco è di circa 800 MB e ha tempi di caricamento minori.

==Legato a Blood Omen==
Solo scaricare una copia in locale del repositorio non fornisce una versione funzionante del gioco. Dato che Blood Omnicide è un port dipende sostanzialmente sui file multimediali del gioco originale.

I file di Blood Omen vengono copiati quando la versione release di Blood Omnicide viene installata su un computer. La versione per lo sviluppo non ha un installer simile, ma ha un '''test installation script''' (script per la prova d'installazione) che fa la stessa cosa. Il procedimento per avere una versione funzionante di Blood Omnicide si chiama '''test installation''' (installazione di prova).

==Sorgenti e salvataggi==
Tutti i sorgenti dei file multimediali vengono salvate con SVN, inclusi i file sorgenti per i tool, le texture e i modelli. L'unico caso in cui un file sorgente non viene salvato è se è troppo grande (più di 100Mb). I sorgenti vengono salvati nella stessa cartella dei file esportati. Non è necessario spiegare più in dettaglio il codice sorgente, ma lo è per le texture e i modelli:

'''Sorgenti delle texture'''
:La fonte è l'immagine base (PSD o quello che è) che viene esportata come texture [[TGA]].

'''Sorgenti dei modelli'''
:Questi hanno molte varianti. Per i modelli statici la soluzione migliore è creare dei file [[ASE]]; se i modelli sono animati vanno bene tutti i tipi file sorgenti  (MAX, blend...)

==Convenzioni==
Alcune regole da seguire per mantenere in ordine il repositorio.

'''Nomi dei file'''
:Tutti i file, le cartelle, le estensioni devono essere minuscoli, in caratteri latini e senza spazi. Non seguire questa regola può generare una serie di problemi, come una trasferibilità limitata e degli errori con SVN.

'''I commit'''
:Non fare i commit di file che nessuno userà. SVN non è una versione leggera di FTP: mantiene tutte le versioni dei file, anche se vengono cancellati. Quindi caricarla troppo di file inutilizzati serve solo a sprecare spazio.

{{capitolo successivo|Compilazione del gioco}}
{{finished}}
{{initalian|Concetti chiave}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Convenzioni per i nomi</title>
    <ns>0</ns>
    <id>610</id>
      <sha1>qb31gjypdfeu2hgmxid2d4mbtvdj7uo</sha1>
    <revision>
      <id>3432</id>
      <timestamp>2013-01-22T15:44:57Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Build del gioco}} Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le re...&quot;</comment>
      <text xml:space="preserve" bytes="3887">{{navigation title|Build del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{important|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Sbagliati:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3434</id>
      <timestamp>2013-01-22T17:56:57Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3915">{{navigation title|Guida al repositorio di SVN/Build del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{important|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Sbagliati:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3471</id>
      <timestamp>2013-01-22T19:12:08Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3929">{{capitolo precedente|Build del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{important|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Sbagliati:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{capitolo successivo|}}
{{finished}}
{{initalian|Convenzioni per i nomi}}</text>
    </revision>
    <revision>
      <id>3477</id>
      <timestamp>2013-01-22T19:23:02Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3930">{{capitolo precedente|Build del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{importante|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Sbagliati:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{capitolo successivo|}}
{{finished}}
{{initalian|Convenzioni per i nomi}}</text>
    </revision>
    <revision>
      <id>3488</id>
      <timestamp>2013-01-22T20:06:01Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3925">{{capitolo precedente|Build del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{importante|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=red&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=red&gt;// Sbagliati&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{capitolo successivo|}}
{{finished}}
{{initalian|Convenzioni per i nomi}}</text>
    </revision>
    <revision>
      <id>3489</id>
      <timestamp>2013-01-22T20:06:44Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* Elementi delle mappe */</comment>
      <text xml:space="preserve" bytes="3924">{{capitolo precedente|Build del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{importante|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=red&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=red&gt;// Sbagliati&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{capitolo successivo|}}
{{finished}}
{{initalian|Convenzioni per i nomi}}</text>
    </revision>
    <revision>
      <id>3504</id>
      <timestamp>2013-01-24T14:00:15Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="3931">{{capitolo precedente|Compilazione del gioco}}
Le convenzioni per i nomi sono necessarie per mantenere in ordine il repositorio e per rendere facile lavorarci. Alcuni file violano le regole comuni, rendendosi i primi candidati per essere rinominati.

Fare sempre in modo di attenersi a queste convenzioni quando si aggiungono nuovi file al repositorio.

==Nomi delle texture==
Il nome di una texture deve essere una o due parole che spiegano l'uso della texture stessa.

Le texture speciali (mappature delle normali, dei glow...) devono avere un suffisso secondo le regole dello skinframe (vedi [[texture]])

Modello di nome:
: nometexture''&lt;gruppo_numero&gt;''_''&lt;variazione_numero&gt;''

Esempio:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Nomi dei materiali==
I nomi dei materiali devono riprendere i nomi delle texture, dove possibile. Per motivi di trasmissibilità devono esserci solo barre ('''/'''), non barre capovolte.

Se il materiale è una variazione o un livello aggiuntivo di un materiale base il suo nome deve iniziare come quello del materiale base.

Esempio:
 textures/inn/window &lt;font color=green&gt;// materiale base&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// livello aggiuntivo per l'enVMap&lt;/font&gt;

==Temi delle texture==
I temi delle texture sono un metodo per classificare le texture nell'editor dei livelli. Nell'elenco delle texture è possibile guardare solo un tema alla volta. Può anche essere un buon metodo per separare i file in più cartelle.

Il tema di una texture deve essere di una paola e deve spiegare che per cosa sarà usata la texture (ad esempio per la cripta, il mausoleo, la locanda...).

Esempi:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Nomi dei modelli==
I nomi dei materiali possono contenere caratteri latini minuscoli, numeri, underscore ('''_''') e spazi. I nomi devono avere sensati, suffissi e numeri vanno aggiunti solo se il modello è parte di un gruppo.

{{importante|Alcuni programmi per esportare i file, ad esempio 3D Studio Max ASE exporter, scrivono sempre le estensioni dei file in maiuscolo. Vanno modificate prima che i modelli siano caricati nel repositorio}}

Esempi:
 &lt;font color=green&gt;// Corretti&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=red&gt;// Sbagliati&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Temi dei modelli==
Come i temi delle texture, i temi dei modelli sono sottocartelle in '''models/mapobjects/'''. Il nome del tema di un modello deve essere di una parola, e deve spiegare per che cosa i modelli verranno utilizzati.

Esempi:
 crypt
 dungeon
 graveyard

==Nomi delle mappe==
Il nome della mappa contiene la posizione della mappa stessa all'interno della gerarchia:
* '''Mondo''' 
** '''Ubicazione'''
*** '''Sub-ubicazione''' (opzionale)
Modello di nome:
:w''&lt;numeromondo&gt;''m''&lt;numeroubicazione&gt;''-''&lt;nome_ubicazione&gt;''-''&lt;nome_sub_ubicazione&gt;''

Se una sub-ubicazione è di un tipo ripetuto più volte (ci sono più cripte, caverne...) la prima non devee avere il numero 1 alla fine.

Esempi: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

I livelli per i test sono eccezioni, e va aggiunto il prefisso '''test-''' al loro nome. I livelli per i test non vengono aggiunti alla build della versione release.

==Elementi delle mappe==
Tutti gli elementi delle mappe vengono salvati nelle cartelle models/maps/&lt;nome_posizione&gt;. Vanno nominati secondo la loro convenzione.

Esempi:

 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=red&gt;// Sbagliati&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{capitolo successivo|}}
{{finished}}
{{initalian|Convenzioni per i nomi}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Introduzione</title>
    <ns>0</ns>
    <id>603</id>
      <sha1>3oyjboyxhhe3oly2lacthrvi74bydei</sha1>
    <revision>
      <id>3399</id>
      <timestamp>2013-01-22T13:09:56Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|}}  Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sor...&quot;</comment>
      <text xml:space="preserve" bytes="3061">{{navigation title|}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col reporisorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per la build della versione definitiva del gioco.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;


{{navigation footer|Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3402</id>
      <timestamp>2013-01-22T13:34:17Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="3060">{{navigation title|}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col reporisorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per la build della versione definitiva del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;


{{navigation footer|Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3404</id>
      <timestamp>2013-01-22T13:59:40Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Sguardo preliminare */</comment>
      <text xml:space="preserve" bytes="3054">{{navigation title|}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col reporisorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per la versione build del gioco definitivo
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;


{{navigation footer|Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3408</id>
      <timestamp>2013-01-22T14:14:44Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3109">{{navigation title|Guida al repositorio di SVN}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per la versione build del gioco definitivo
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;


{{navigation footer|Guida al repositorio di SVN/Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3409</id>
      <timestamp>2013-01-22T14:17:24Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3110">{{navigation title|Guida al repositorio di SVN}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;


{{navigation footer|Guida al repositorio di SVN/Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3411</id>
      <timestamp>2013-01-22T14:19:47Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3108">{{navigation title|Guida al repositorio di SVN}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{initalian|Introduzione}}
{{navigation footer|Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3414</id>
      <timestamp>2013-01-22T14:22:53Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3109">{{navigation title|Guida al repositorio di SVN}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3GB di banda. La copia scaricata occupa circa 10GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{navigation footer|Guida al repositorio di SVN/Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3417</id>
      <timestamp>2013-01-22T14:27:33Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3111">{{navigation title|Guida al repositorio di SVN}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3 GB di banda. La copia scaricata occupa circa 10 GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{navigation footer|Guida al repositorio di SVN/Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3450</id>
      <timestamp>2013-01-22T18:40:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3107">{{intestazione|Guida al repositorio di SVN}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3 GB di banda. La copia scaricata occupa circa 10 GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{navigation footer|Guida al repositorio di SVN/Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3465</id>
      <timestamp>2013-01-22T19:06:35Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3061">{{capitolo precedente|}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3 GB di banda. La copia scaricata occupa circa 10 GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{capitolo successivo|Concetti chiave}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3468</id>
      <timestamp>2013-01-22T19:11:56Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3088">{{capitolo precedente|}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Important|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3 GB di banda. La copia scaricata occupa circa 10 GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{Tip|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{capitolo successivo|Concetti chiave}}
{{finished}}
{{initalian|Introduzione}}</text>
    </revision>
    <revision>
      <id>3486</id>
      <timestamp>2013-01-22T20:03:54Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="3095">{{capitolo precedente|}}

Il repositorio di Blood Omnicide contiene tutti i file necessari al processo dello sviluppo. Contiene i file di gioco, i file multimediali, i codici sorgente, alcuni tool utili e altre cose che servono a facilitare il lavoro su vari aspetti del gioco. Il repositorio di Blood Omnicide contiene una versione del progetto al suo ultimo stato di progresso, oltre a tutte le versioni precedenti.

Prima di cominciare a lavorare col repositorio di Blood Omnicide assicurarsi di sapere bene come funziona il sistema di controllo versioni e in particolare [http://it.wikipedia.org/wiki/Subversion SVN].

==Avere una copia in locale==
Questo è il primo passo per lavorare col repositorio di Blood Omnicide: scaricare una copia in locale del repositorio stesso.

Installare il client di SVN (è raccomandata la versione Windows [http://tortoisesvn.net/ TortoiseSVN]). Per eseguire il comando '''svn checkout''' basta avere l'indirizzo del repositorio, non c'è nessuna password.
{{Importante|Assicurarsi che il percorso della cartella per la copia in locale sia semplice e non contenga caratteri non latini né spazi bianchi:}}
 &lt;font color=red&gt;// Sbagliato&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Corretto&lt;/font&gt;
 c:\OmnicideSVN

Scaricare una copia completa in locale occupa circa 3 GB di banda. La copia scaricata occupa circa 10 GB; assicurarsi di avere almeno il doppio dello spazio libero, perché crescerà col tempo.
{{consiglio|Il download può essere interrotto e ripreso in qualsiasi momento}}

==Sguardo preliminare==
Quando il download sarà finito saranno visibili:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| i file binari per le piattaforme x86
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| i file binari per le piattaforme x64
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| il codice sorgente e i tool del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| la cartella di gioco con tutti i file di Blood Omnicide (texture, mappe, script...)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| gli script per l'installazione e per compilare la versione release del gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| l'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| i file help, le icone, altre immagini...
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| la licenza GNU GPL v2
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| il launcher di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| l'eseguibile di Blood Omnicide
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| l'eseguibile di Blood Omnicide solo per la fase di sviluppo (con un maggiore limite di entità)
|}
&lt;/div&gt;

{{capitolo successivo|Concetti chiave}}
{{finished}}
{{initalian|Introduzione}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Script per l'automazione</title>
    <ns>0</ns>
    <id>626</id>
      <sha1>ciaeeuuumkj5kpe05ucetxnrgntvjo3</sha1>
    <revision>
      <id>3513</id>
      <timestamp>2013-01-24T14:36:58Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{capitolo precedente|}}  Il repositorio di Blood Omnicide contiene un certo numero di script per l'automazione, usati per semplificare lo svolgimento di alcune azioni molto c...&quot;</comment>
      <text xml:space="preserve" bytes="2887">{{capitolo precedente|}}

Il repositorio di Blood Omnicide contiene un certo numero di script per l'automazione, usati per semplificare lo svolgimento di alcune azioni molto comuni. Il capitolo [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco|Compilazione del gioco]] parla di uno degli script per l'automazione maggiori. Questa appendice ne elenca qualcun'altro.

==Automazione dei materiali==
Ci sono diversi script per aiutare coi materiali. Tutti gli script sono dentro a '''kain/scripts/automation/'''

===Materiali per la creazione del terreno===
I materiali dei terreni in Blood Omnicide vengono già generati con circa 20 texture del terreno (roccia, erba, suolo ecc.) e con tutte le combinazioni dei materiali (roccia-erba, erba-suolo, suolo-roccia ecc.).

Tutte le texture per i terreni disponibli sono elencate in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': genera i materiali di radiant/textures (serve ImageMagick 6.6.7 Q8 installato in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': genera textures_terrain.shader per il terreno

===Compilare shaderlist.txt===
Il file scripts/shaderlist.txt è usato dal compilatore delle mappe e dall'editor di livelli per caricare i file .shader. Ogni volta che vengono aggiunti gli script di nuovi materiali questo file deve essere ricreato.

* '''make_shaderlist.cmd''': genera shaderlist.txt

===Compilare gli skip shader===
L'editor di livelli è stupido, non sa cos'è una normal map. Quindi mostra quelle, le texture speculari e tutte le altre texture aggiuntive nella finestra texture, il che è sbagliato. Per impedire che accada viene creato un file speciale del materiale per l'editor di livelli che gli segnala di &quot;saltare&quot; (skip) tutte queste texture. Questo script deve essere lanciato ogni volta che una normal map, una texture speculare o un'altra texture viene aggiunta.

* '''make_shaders_skip.cmd''': genera radiant/scripts/skip.shader

==Automazione della musica==
Gli script per l'automazione della musica vengono creati per facilitare la pubblicazione di nuove tracce di Bloody Sounds. Sono molto semplici. Tutti gli script sono dentro a '''kain\music\automation'''.

* '''make_files.bat''': crea file .mp3 e ZIP di Bloody Sounds che contengono tutti i gile OGG
* '''make_html.bat''': crea il codice HTML per la pagina in russo di Bloody Sounds
* '''make_html_en.bat''': crea il codice HTML per la pagina in inglese di Bloody Sounds

==Automazione della mappa==
Vengono creati molti file temporanei durante la compilazione. Questi file sono: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': rimuove tutti i file temporanei

{{importante|Questo script rimuove tutti i salvataggi automatici creati per le mappe. Usarlo con attenzione!}}


{{initalian|Script per l'automazione}}
{{capitolo successivo|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3514</id>
      <timestamp>2013-01-24T14:38:24Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Automazione dei materiali */</comment>
      <text xml:space="preserve" bytes="2886">{{capitolo precedente|}}

Il repositorio di Blood Omnicide contiene un certo numero di script per l'automazione, usati per semplificare lo svolgimento di alcune azioni molto comuni. Il capitolo [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco|Compilazione del gioco]] parla di uno degli script per l'automazione maggiori. Questa appendice ne elenca qualcun'altro.

==Automazione dei materiali==
Ci sono diversi script per aiutare coi materiali. Tutti gli script sono dentro a '''kain/scripts/automation/'''

===Materiali per la creazione del terreno===
I materiali dei terreni in Blood Omnicide vengono già generati con circa 20 texture del terreno (roccia, erba, suolo ecc.) e con tutte le combinazioni dei materiali (roccia-erba, erba-suolo, suolo-roccia ecc.).

Tutte le texture per i terreni disponibli sono elencate in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': genera i materiali di radiant/textures (serve ImageMagick 6.6.7 Q8 installato in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': genera textures_terrain.shader per il terreno

===Compilare shaderlist.txt===
Il file scripts/shaderlist.txt è usato dal compilatore delle mappe e dall'editor di livelli per caricare i file .shader. Ogni volta che vengono aggiunti gli script di nuovi materiali questo file deve essere ricreato.

* '''make_shaderlist.cmd''': genera shaderlist.txt

===Compilare lo skip shader===
L'editor di livelli è stupido, non sa cos'è una normal map. Quindi mostra quelle, le texture speculari e tutte le altre texture aggiuntive nella finestra texture, il che è sbagliato. Per impedire che accada viene creato un file speciale del materiale per l'editor di livelli che gli segnala di &quot;saltare&quot; (skip) tutte queste texture. Questo script deve essere lanciato ogni volta che una normal map, una texture speculare o un'altra texture viene aggiunta.

* '''make_shaders_skip.cmd''': genera radiant/scripts/skip.shader

==Automazione della musica==
Gli script per l'automazione della musica vengono creati per facilitare la pubblicazione di nuove tracce di Bloody Sounds. Sono molto semplici. Tutti gli script sono dentro a '''kain\music\automation'''.

* '''make_files.bat''': crea file .mp3 e ZIP di Bloody Sounds che contengono tutti i gile OGG
* '''make_html.bat''': crea il codice HTML per la pagina in russo di Bloody Sounds
* '''make_html_en.bat''': crea il codice HTML per la pagina in inglese di Bloody Sounds

==Automazione della mappa==
Vengono creati molti file temporanei durante la compilazione. Questi file sono: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': rimuove tutti i file temporanei

{{importante|Questo script rimuove tutti i salvataggi automatici creati per le mappe. Usarlo con attenzione!}}


{{initalian|Script per l'automazione}}
{{capitolo successivo|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3515</id>
      <timestamp>2013-01-24T14:38:50Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Automazione dei materiali */</comment>
      <text xml:space="preserve" bytes="2887">{{capitolo precedente|}}

Il repositorio di Blood Omnicide contiene un certo numero di script per l'automazione, usati per semplificare lo svolgimento di alcune azioni molto comuni. Il capitolo [[Portal:InItalian/Guida al repositorio di SVN/Compilazione del gioco|Compilazione del gioco]] parla di uno degli script per l'automazione maggiori. Questa appendice ne elenca qualcun'altro.

==Automazione dei materiali==
Ci sono diversi script per aiutare coi materiali. Tutti gli script sono dentro a '''kain/scripts/automation/'''

===Materiali per la creazione del terreno===
I materiali dei terreni in Blood Omnicide vengono già generati con circa 20 texture del terreno (roccia, erba, suolo ecc.) e con tutte le combinazioni dei materiali (roccia-erba, erba-suolo, suolo-roccia ecc.).

Tutte le texture per i terreni disponibli sono elencate in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': genera i materiali di radiant/textures (serve ImageMagick 6.6.7 Q8 installato in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': genera textures_terrain.shader per il terreno

===Compilare shaderlist.txt===
Il file scripts/shaderlist.txt è usato dal compilatore delle mappe e dall'editor di livelli per caricare i file .shader. Ogni volta che vengono aggiunti gli script di nuovi materiali questo file deve essere ricreato.

* '''make_shaderlist.cmd''': genera shaderlist.txt

===Compilare gli skip shader===
L'editor di livelli è stupido, non sa cos'è una normal map. Quindi mostra quelle, le texture speculari e tutte le altre texture aggiuntive nella finestra texture, il che è sbagliato. Per impedire che accada viene creato un file speciale del materiale per l'editor di livelli che gli segnala di &quot;saltare&quot; (skip) tutte queste texture. Questo script deve essere lanciato ogni volta che una normal map, una texture speculare o un'altra texture viene aggiunta.

* '''make_shaders_skip.cmd''': genera radiant/scripts/skip.shader

==Automazione della musica==
Gli script per l'automazione della musica vengono creati per facilitare la pubblicazione di nuove tracce di Bloody Sounds. Sono molto semplici. Tutti gli script sono dentro a '''kain\music\automation'''.

* '''make_files.bat''': crea file .mp3 e ZIP di Bloody Sounds che contengono tutti i gile OGG
* '''make_html.bat''': crea il codice HTML per la pagina in russo di Bloody Sounds
* '''make_html_en.bat''': crea il codice HTML per la pagina in inglese di Bloody Sounds

==Automazione della mappa==
Vengono creati molti file temporanei durante la compilazione. Questi file sono: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': rimuove tutti i file temporanei

{{importante|Questo script rimuove tutti i salvataggi automatici creati per le mappe. Usarlo con attenzione!}}


{{initalian|Script per l'automazione}}
{{capitolo successivo|}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Guida al repositorio di SVN/Struttura del repositorio nel dettaglio</title>
    <ns>0</ns>
    <id>624</id>
      <sha1>m7fm3pax5klvu5v499dodr7da0jjmlp</sha1>
    <revision>
      <id>3500</id>
      <timestamp>2013-01-24T13:53:25Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|}} {{grammar}} ==File degli utenti== Sono i file creati dagli utenti, in base alle impostazioni dell'engine; possono essere messi nella cartella di gioco o ...&quot;</comment>
      <text xml:space="preserve" bytes="14531">{{navigation title|}}
{{grammar}}
==File degli utenti==
Sono i file creati dagli utenti, in base alle impostazioni dell'engine; possono essere messi nella cartella di gioco o in '''My Documents/My Games/omnicide'''.
Ecco una lista abbozzata di questi file:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| questa cartella viene creata e gestita dall'engine; contiene i salvataggi, i file modificati, i file temporanei ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| file DDS (font, immagini locali...) creati dinamicamente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| gli screenshot presi durante il gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| I video delle cinematiche e quelli registrati con '''cl_capturevideo'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| file delle configurazioni di gioco
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| file log dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| cronologia dei comandi dati dalla console
|}
&lt;/div&gt;

==File di gioco==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| filtri per il cube map light cubemap lighting usati sulle luci (le cube map animate si trovano nelle sottocartelle in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| script relativi al gioco (script delle mappe, dei modelli ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| tutte le texture 2D usate per l'interfaccia grafica utente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| shader di OpenGL GLSL
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| questa cartella contiene tutti i file locali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| i livelli del gioco e i loro file aggiuntivi (luci, sorgenti, lightmap ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| tutti i modelli 3D di gioco e le loro texture
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| musica di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| le texture usate per gli effetti particellari
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| le texture e gli script usati dall'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| gli script dei materiali e gli script per il lato client (come i menù, gli ambienti ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| tutti gli effetti sonori di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| le texture usate sulle superfici delle mappe (pennelli, curve, terreni ecc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| game logic compilata per il lato client
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| script per gli effetti
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| file originali di Blood Omen (creati durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| effetti sonori di Blood Omen dalla versione demo; questo file esiste solo se si installa usando la versione PlayStation del gioco
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Cinematiche di Blood Omen (create durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| cache DDS degli sprite di Blood Omen
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| cache DDS delle texture create (vedi [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| tabella dei tipi di luci
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| game logic compilata per i menù
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| file originale di Blood Omen (copiato durante l'installazione)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| game logic compilata per il lato server
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| file startup dell'engine
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|script di configurazione della mappa]]; ogni file contiene lo script per una specifica mappa
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|script per i modelli di gioco]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| file delle configurazioni di default
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| [[CFG|file di configurazione]] dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| file di configurazione specifico per Blood Omnicide (caricato dopo quello dell'engine)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|script per la mappa del mondo]] per la parte di gioco del prologo
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| script per la mappa del mondo per la parte presente di gioco
|}
&lt;/div&gt;

===textures/===
{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| texture per i [[Common materials|materiali comuni]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| texture per il tema 'cellar'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| texture per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| tutte le decal texture (texture parzialmente trasparenti applicate sopra ad altre texture)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| texture per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment map e cube map usate sui materiali per i riflessi delle cube map e il tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| texture usate per i liquidi (lava, acqua, palude ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| texture per il tema 'mausoleum'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murali per gli incantesimi, gli artefatti, gli eventi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| texture per le insegne
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| texture speciali (overlay, texture per materiali e forze ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| texture per le superfici generiche
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| texture usate per il terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| texture per il tema 'town'
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| texture nera semplice
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| texture generica per testare le distorsioni UV
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| modelli 3D dei prigionieri
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| modelli 3D di prova per i nemici
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| modelli usati per gli [[Environment script|script dell'ambiente]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| modelli vari usati negli effetti speciali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| modelli degli oggetti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| modelli da usare nei livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| modelli specifici per decorare i livelli (come i terreni)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| tutti i nuovi modelli che devono essere approvati (e per cui vanno creati texture e materiale) vanno qui
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| modelli del fogliame, come l'erba
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| tutto ciò che serve solo per dei test (che non sarà esportato nell'installer di gioco)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| modelli da usare per le varie trappole
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| modelli delle armi
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| modello cubico di 4x4 unità
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| modello senza geometrie
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| una sfera con una freccia (usato a scopo di test)
|}
&lt;/div&gt;

====models/mapobjects/====
Una delle cartelle di modelli più grandi. Contiene modelli da usare nei livelli come [[func_model]] o [[func_gamemodel]].

{{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| modelli per il tema 'cave'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| modelli per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| modelli per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| modelli per il tema 'graveyard'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| modelli per il tema 'inn'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| modelli senza un tema usati in più ambienti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| modelli per il tema 'Nosgoth Outdoors'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| modelli usati nei punti con gli spuncioni
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| modelli per il tema 'town'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| modelli degli alberi
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| l'utility [[Portal:InItalian/Blood Pill | Blood Pill]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| i tool per realizzare le cube map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| codice sorgente per il launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| i tool per la modellazione (strumenti per convertire e per esportare)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| script di syntax highlight per Notepad ++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| altri tool
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| codice sorgente della game logic di QuakeC (client, server e menù)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| tool per modificare gli sprite
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| il tool DPMWizard (per creare modelli [[DPM]] partendo da modelli [[SMD]] di Half-Life)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| un vecchio tool per generare terreni basati sui pennelli partendo da heightmap o da rumori casuali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| plugin per importare o esportare in vari formati di gioco usati dalla Darkplaces engine
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| codice sorgente per i plugin
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| vecchio programma per modificare i modelli [[MDL]]
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[Portal:InItalian/MD3 Compiler | MD3 Compiler di NPherno]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| sorgenti di QuakeC per i programmi per il lato client
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| sorgenti di QuakeC per i programmi per il menù
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| sorgenti di QuakeC per i programmi per il gioco (game logic del server)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| codice condiviso di QuakeC (librerie, sistemi)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| lo script per compilare i programmi del lato client dentro a '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| lo script per compilare i programmi del menù dentro a '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| lo script per compilare i programmi di gioco dentro a '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| compilatore sorgente di FTEQCC per QuakeC
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| Scanner dei sorgenti - un tool per creare le definizioni delle entità dell'editor di livelli (mapeditor/kain.game/kain/entities.ent) dal sorgente di QuakeC.
|}
&lt;/div&gt;

==Miscellanea==
Tutti gli altri file sono conenuti nella cartella '''misc/''', in cui possono esserci molte sottocartelle tra le quali qui nominiamo solo le più utili.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| documentazione varia sul gioco originale, i testi dei dialoghi, l'elenco dei danni delle armi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| tutta la concept art realizzata per Blood Omnicide
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| vari file grafici non utilizzati per il gioco (loghi, icone, design del sito ecc.)
|}
&lt;/div&gt;


{{initalian|Struttura del repositorio nel dettaglio}}
{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3507</id>
      <timestamp>2013-01-24T14:10:47Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="14536">{{capitolo precedente|}}
{{grammar}}
==File degli utenti==
Sono i file creati dagli utenti, in base alle impostazioni dell'engine; possono essere messi nella cartella di gioco o in '''My Documents/My Games/omnicide'''.
Ecco una lista abbozzata di questi file:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| questa cartella viene creata e gestita dall'engine; contiene i salvataggi, i file modificati, i file temporanei ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| file DDS (font, immagini locali...) creati dinamicamente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| gli screenshot presi durante il gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| I video delle cinematiche e quelli registrati con '''cl_capturevideo'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| file delle configurazioni di gioco
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| file log dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| cronologia dei comandi dati dalla console
|}
&lt;/div&gt;

==File di gioco==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| filtri per il cube map light cubemap lighting usati sulle luci (le cube map animate si trovano nelle sottocartelle in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| script relativi al gioco (script delle mappe, dei modelli ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| tutte le texture 2D usate per l'interfaccia grafica utente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| shader di OpenGL GLSL
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| questa cartella contiene tutti i file locali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| i livelli del gioco e i loro file aggiuntivi (luci, sorgenti, lightmap ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| tutti i modelli 3D di gioco e le loro texture
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| musica di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| le texture usate per gli effetti particellari
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| le texture e gli script usati dall'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| gli script dei materiali e gli script per il lato client (come i menù, gli ambienti ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| tutti gli effetti sonori di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| le texture usate sulle superfici delle mappe (pennelli, curve, terreni ecc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| game logic compilata per il lato client
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| script per gli effetti
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| file originali di Blood Omen (creati durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| effetti sonori di Blood Omen dalla versione demo; questo file esiste solo se si installa usando la versione PlayStation del gioco
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Cinematiche di Blood Omen (create durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| cache DDS degli sprite di Blood Omen
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| cache DDS delle texture create (vedi [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| tabella dei tipi di luci
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| game logic compilata per i menù
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| file originale di Blood Omen (copiato durante l'installazione)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| game logic compilata per il lato server
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| file startup dell'engine
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|script di configurazione della mappa]]; ogni file contiene lo script per una specifica mappa
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|script per i modelli di gioco]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| file delle configurazioni di default
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| [[CFG|file di configurazione]] dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| file di configurazione specifico per Blood Omnicide (caricato dopo quello dell'engine)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|script per la mappa del mondo]] per la parte di gioco del prologo
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| script per la mappa del mondo per la parte presente di gioco
|}
&lt;/div&gt;

===textures/===
{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| texture per i [[Common materials|materiali comuni]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| texture per il tema 'cellar'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| texture per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| tutte le decal texture (texture parzialmente trasparenti applicate sopra ad altre texture)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| texture per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment map e cube map usate sui materiali per i riflessi delle cube map e il tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| texture usate per i liquidi (lava, acqua, palude ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| texture per il tema 'mausoleum'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murali per gli incantesimi, gli artefatti, gli eventi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| texture per le insegne
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| texture speciali (overlay, texture per materiali e forze ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| texture per le superfici generiche
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| texture usate per il terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| texture per il tema 'town'
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| texture nera semplice
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| texture generica per testare le distorsioni UV
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| modelli 3D dei prigionieri
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| modelli 3D di prova per i nemici
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| modelli usati per gli [[Environment script|script dell'ambiente]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| modelli vari usati negli effetti speciali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| modelli degli oggetti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| modelli da usare nei livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| modelli specifici per decorare i livelli (come i terreni)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| tutti i nuovi modelli che devono essere approvati (e per cui vanno creati texture e materiale) vanno qui
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| modelli del fogliame, come l'erba
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| tutto ciò che serve solo per dei test (che non sarà esportato nell'installer di gioco)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| modelli da usare per le varie trappole
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| modelli delle armi
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| modello cubico di 4x4 unità
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| modello senza geometrie
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| una sfera con una freccia (usato a scopo di test)
|}
&lt;/div&gt;

====models/mapobjects/====
Una delle cartelle di modelli più grandi. Contiene modelli da usare nei livelli come [[func_model]] o [[func_gamemodel]].

{{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| modelli per il tema 'cave'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| modelli per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| modelli per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| modelli per il tema 'graveyard'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| modelli per il tema 'inn'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| modelli senza un tema usati in più ambienti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| modelli per il tema 'Nosgoth Outdoors'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| modelli usati nei punti con gli spuncioni
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| modelli per il tema 'town'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| modelli degli alberi
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| l'utility [[Portal:InItalian/Blood Pill | Blood Pill]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| i tool per realizzare le cube map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| codice sorgente per il launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| i tool per la modellazione (strumenti per convertire e per esportare)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| script di syntax highlight per Notepad ++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| altri tool
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| codice sorgente della game logic di QuakeC (client, server e menù)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| tool per modificare gli sprite
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| il tool DPMWizard (per creare modelli [[DPM]] partendo da modelli [[SMD]] di Half-Life)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| un vecchio tool per generare terreni basati sui pennelli partendo da heightmap o da rumori casuali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| plugin per importare o esportare in vari formati di gioco usati dalla Darkplaces engine
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| codice sorgente per i plugin
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| vecchio programma per modificare i modelli [[MDL]]
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[Portal:InItalian/MD3 Compiler | MD3 Compiler di NPherno]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| sorgenti di QuakeC per i programmi per il lato client
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| sorgenti di QuakeC per i programmi per il menù
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| sorgenti di QuakeC per i programmi per il gioco (game logic del server)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| codice condiviso di QuakeC (librerie, sistemi)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| lo script per compilare i programmi del lato client dentro a '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| lo script per compilare i programmi del menù dentro a '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| lo script per compilare i programmi di gioco dentro a '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| compilatore sorgente di FTEQCC per QuakeC
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| Scanner dei sorgenti - un tool per creare le definizioni delle entità dell'editor di livelli (mapeditor/kain.game/kain/entities.ent) dal sorgente di QuakeC.
|}
&lt;/div&gt;

==Miscellanea==
Tutti gli altri file sono conenuti nella cartella '''misc/''', in cui possono esserci molte sottocartelle tra le quali qui nominiamo solo le più utili.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| documentazione varia sul gioco originale, i testi dei dialoghi, l'elenco dei danni delle armi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| tutta la concept art realizzata per Blood Omnicide
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| vari file grafici non utilizzati per il gioco (loghi, icone, design del sito ecc.)
|}
&lt;/div&gt;


{{initalian|Struttura del repositorio nel dettaglio}}
{{capitolo successivo|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3511</id>
      <timestamp>2013-01-24T14:18:17Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="14608">{{capitolo precedente|}}
{{grammar}}
==File degli utenti==
Sono i file creati dagli utenti, in base alle impostazioni dell'engine; possono essere messi nella cartella di gioco o in '''My Documents/My Games/omnicide'''.
Ecco una lista abbozzata di questi file:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| questa cartella viene creata e gestita dall'engine; contiene i salvataggi, i file modificati, i file temporanei ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| file DDS (font, immagini locali...) creati dinamicamente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| gli screenshot presi durante il gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| I video delle cinematiche e quelli registrati con '''cl_capturevideo'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| file delle configurazioni di gioco
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| file log dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| cronologia dei comandi dati dalla console
|}
&lt;/div&gt;

==File di gioco==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| filtri per il cube map light cubemap lighting usati sulle luci (le cube map animate si trovano nelle sottocartelle in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| script relativi al gioco (script delle mappe, dei modelli ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| tutte le texture 2D usate per l'interfaccia grafica utente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| shader di OpenGL GLSL
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| questa cartella contiene tutti i file locali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| i livelli del gioco e i loro file aggiuntivi (luci, sorgenti, lightmap ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| tutti i modelli 3D di gioco e le loro texture
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| musica di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| le texture usate per gli effetti particellari
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| le texture e gli script usati dall'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| gli script dei materiali e gli script per il lato client (come i menù, gli ambienti ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| tutti gli effetti sonori di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| le texture usate sulle superfici delle mappe (pennelli, curve, terreni ecc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| game logic compilata per il lato client
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| script per gli effetti
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| file originali di Blood Omen (creati durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| effetti sonori di Blood Omen dalla versione demo; questo file esiste solo se si installa usando la versione PlayStation del gioco
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Cinematiche di Blood Omen (create durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| cache DDS degli sprite di Blood Omen
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| cache DDS delle texture create (vedi [[Guida_al_repositorio_di_SVN/Compilazione_del_gioco#Cache_DDS_per_le_texture|Compilazione del gioco/Cache DDS per le texture]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| tabella dei tipi di luci
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| game logic compilata per i menù
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| file originale di Blood Omen (copiato durante l'installazione)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| game logic compilata per il lato server
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| file startup dell'engine
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|script di configurazione della mappa]]; ogni file contiene lo script per una specifica mappa
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|script per i modelli di gioco]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| file delle configurazioni di default
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| [[CFG|file di configurazione]] dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| file di configurazione specifico per Blood Omnicide (caricato dopo quello dell'engine)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|script per la mappa del mondo]] per la parte di gioco del prologo
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| script per la mappa del mondo per la parte presente di gioco
|}
&lt;/div&gt;

===textures/===
{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| texture per i [[Common materials|materiali comuni]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| texture per il tema 'cellar'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| texture per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| tutte le decal texture (texture parzialmente trasparenti applicate sopra ad altre texture)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| texture per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment map e cube map usate sui materiali per i riflessi delle cube map e il tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| texture usate per i liquidi (lava, acqua, palude ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| texture per il tema 'mausoleum'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murali per gli incantesimi, gli artefatti, gli eventi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| texture per le insegne
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| texture speciali (overlay, texture per materiali e forze ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| texture per le superfici generiche
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| texture usate per il terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| texture per il tema 'town'
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| texture nera semplice
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| texture generica per testare le distorsioni UV
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| modelli 3D dei prigionieri
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| modelli 3D di prova per i nemici
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| modelli usati per gli [[Environment script|script dell'ambiente]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| modelli vari usati negli effetti speciali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| modelli degli oggetti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| modelli da usare nei livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| modelli specifici per decorare i livelli (come i terreni)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| tutti i nuovi modelli che devono essere approvati (e per cui vanno creati texture e materiale) vanno qui
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| modelli del fogliame, come l'erba
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| tutto ciò che serve solo per dei test (che non sarà esportato nell'installer di gioco)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| modelli da usare per le varie trappole
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| modelli delle armi
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| modello cubico di 4x4 unità
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| modello senza geometrie
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| una sfera con una freccia (usato a scopo di test)
|}
&lt;/div&gt;

====models/mapobjects/====
Una delle cartelle di modelli più grandi. Contiene modelli da usare nei livelli come [[func_model]] o [[func_gamemodel]].

{{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| modelli per il tema 'cave'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| modelli per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| modelli per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| modelli per il tema 'graveyard'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| modelli per il tema 'inn'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| modelli senza un tema usati in più ambienti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| modelli per il tema 'Nosgoth Outdoors'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| modelli usati nei punti con gli spuncioni
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| modelli per il tema 'town'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| modelli degli alberi
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| l'utility [[Portal:InItalian/Blood Pill | Blood Pill]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| i tool per realizzare le cube map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| codice sorgente per il launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| i tool per la modellazione (strumenti per convertire e per esportare)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| script di syntax highlight per Notepad ++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| altri tool
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| codice sorgente della game logic di QuakeC (client, server e menù)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| tool per modificare gli sprite
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| il tool DPMWizard (per creare modelli [[DPM]] partendo da modelli [[SMD]] di Half-Life)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| un vecchio tool per generare terreni basati sui pennelli partendo da heightmap o da rumori casuali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| plugin per importare o esportare in vari formati di gioco usati dalla Darkplaces engine
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| codice sorgente per i plugin
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| vecchio programma per modificare i modelli [[MDL]]
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[Portal:InItalian/MD3 Compiler | MD3 Compiler di NPherno]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| sorgenti di QuakeC per i programmi per il lato client
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| sorgenti di QuakeC per i programmi per il menù
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| sorgenti di QuakeC per i programmi per il gioco (game logic del server)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| codice condiviso di QuakeC (librerie, sistemi)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| lo script per compilare i programmi del lato client dentro a '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| lo script per compilare i programmi del menù dentro a '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| lo script per compilare i programmi di gioco dentro a '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| compilatore sorgente di FTEQCC per QuakeC
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| Scanner dei sorgenti - un tool per creare le definizioni delle entità dell'editor di livelli (mapeditor/kain.game/kain/entities.ent) dal sorgente di QuakeC.
|}
&lt;/div&gt;

==Miscellanea==
Tutti gli altri file sono conenuti nella cartella '''misc/''', in cui possono esserci molte sottocartelle tra le quali qui nominiamo solo le più utili.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| documentazione varia sul gioco originale, i testi dei dialoghi, l'elenco dei danni delle armi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| tutta la concept art realizzata per Blood Omnicide
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| vari file grafici non utilizzati per il gioco (loghi, icone, design del sito ecc.)
|}
&lt;/div&gt;


{{initalian|Struttura del repositorio nel dettaglio}}
{{capitolo successivo|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3512</id>
      <timestamp>2013-01-24T14:18:49Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* File di gioco */</comment>
      <text xml:space="preserve" bytes="14625">{{capitolo precedente|}}
{{grammar}}
==File degli utenti==
Sono i file creati dagli utenti, in base alle impostazioni dell'engine; possono essere messi nella cartella di gioco o in '''My Documents/My Games/omnicide'''.
Ecco una lista abbozzata di questi file:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| questa cartella viene creata e gestita dall'engine; contiene i salvataggi, i file modificati, i file temporanei ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| file DDS (font, immagini locali...) creati dinamicamente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| gli screenshot presi durante il gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| I video delle cinematiche e quelli registrati con '''cl_capturevideo'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| file delle configurazioni di gioco
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| file log dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| cronologia dei comandi dati dalla console
|}
&lt;/div&gt;

==File di gioco==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| filtri per il cube map light cubemap lighting usati sulle luci (le cube map animate si trovano nelle sottocartelle in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| script relativi al gioco (script delle mappe, dei modelli ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| tutte le texture 2D usate per l'interfaccia grafica utente
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| shader di OpenGL GLSL
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| questa cartella contiene tutti i file locali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| i livelli del gioco e i loro file aggiuntivi (luci, sorgenti, lightmap ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| tutti i modelli 3D di gioco e le loro texture
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| musica di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| le texture usate per gli effetti particellari
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| le texture e gli script usati dall'editor di livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| gli script dei materiali e gli script per il lato client (come i menù, gli ambienti ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| tutti gli effetti sonori di gioco
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| le texture usate sulle superfici delle mappe (pennelli, curve, terreni ecc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| game logic compilata per il lato client
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| script per gli effetti
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| file originali di Blood Omen (creati durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| effetti sonori di Blood Omen dalla versione demo; questo file esiste solo se si installa usando la versione PlayStation del gioco
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Cinematiche di Blood Omen (create durante l'installazione)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| cache DDS degli sprite di Blood Omen
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| cache DDS delle texture create (vedi [[Portal:InItalian/Guida_al_repositorio_di_SVN/Compilazione_del_gioco#Cache_DDS_per_le_texture|Compilazione del gioco/Cache DDS per le texture]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| tabella dei tipi di luci
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| game logic compilata per i menù
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| file originale di Blood Omen (copiato durante l'installazione)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| game logic compilata per il lato server
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| file startup dell'engine
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|script di configurazione della mappa]]; ogni file contiene lo script per una specifica mappa
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|script per i modelli di gioco]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| file delle configurazioni di default
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| [[CFG|file di configurazione]] dell'engine
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| file di configurazione specifico per Blood Omnicide (caricato dopo quello dell'engine)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|script per la mappa del mondo]] per la parte di gioco del prologo
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| script per la mappa del mondo per la parte presente di gioco
|}
&lt;/div&gt;

===textures/===
{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| texture per i [[Common materials|materiali comuni]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| texture per il tema 'cellar'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| texture per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| tutte le decal texture (texture parzialmente trasparenti applicate sopra ad altre texture)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| texture per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment map e cube map usate sui materiali per i riflessi delle cube map e il tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| texture usate per i liquidi (lava, acqua, palude ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| texture per il tema 'mausoleum'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murali per gli incantesimi, gli artefatti, gli eventi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| texture per le insegne
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| texture speciali (overlay, texture per materiali e forze ecc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| texture per le superfici generiche
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| texture usate per il terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| texture per il tema 'town'
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| texture nera semplice
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| texture generica per testare le distorsioni UV
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| modelli 3D dei prigionieri
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| modelli 3D di prova per i nemici
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| modelli usati per gli [[Environment script|script dell'ambiente]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| modelli vari usati negli effetti speciali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| modelli degli oggetti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| modelli da usare nei livelli
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| modelli specifici per decorare i livelli (come i terreni)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| tutti i nuovi modelli che devono essere approvati (e per cui vanno creati texture e materiale) vanno qui
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| modelli del fogliame, come l'erba
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| tutto ciò che serve solo per dei test (che non sarà esportato nell'installer di gioco)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| modelli da usare per le varie trappole
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| modelli delle armi
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| modello cubico di 4x4 unità
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| modello senza geometrie
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| una sfera con una freccia (usato a scopo di test)
|}
&lt;/div&gt;

====models/mapobjects/====
Una delle cartelle di modelli più grandi. Contiene modelli da usare nei livelli come [[func_model]] o [[func_gamemodel]].

{{{consiglio|Man mano che lo sviluppo procede vengono aggiunti nuovi temi.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| modelli per il tema 'cave'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| modelli per il tema 'crypt'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| modelli per il tema 'dungeon'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| modelli per il tema 'graveyard'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| modelli per il tema 'inn'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| modelli senza un tema usati in più ambienti
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| modelli per il tema 'Nosgoth Outdoors'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| modelli usati nei punti con gli spuncioni
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| modelli per il tema 'town'
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| modelli degli alberi
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| l'utility [[Portal:InItalian/Blood Pill | Blood Pill]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| i tool per realizzare le cube map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| codice sorgente per il launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| i tool per la modellazione (strumenti per convertire e per esportare)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| script di syntax highlight per Notepad ++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| altri tool
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| codice sorgente della game logic di QuakeC (client, server e menù)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| tool per modificare gli sprite
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| il tool DPMWizard (per creare modelli [[DPM]] partendo da modelli [[SMD]] di Half-Life)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| un vecchio tool per generare terreni basati sui pennelli partendo da heightmap o da rumori casuali
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| plugin per importare o esportare in vari formati di gioco usati dalla Darkplaces engine
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| codice sorgente per i plugin
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| vecchio programma per modificare i modelli [[MDL]]
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[Portal:InItalian/MD3 Compiler | MD3 Compiler di NPherno]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| sorgenti di QuakeC per i programmi per il lato client
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| sorgenti di QuakeC per i programmi per il menù
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| sorgenti di QuakeC per i programmi per il gioco (game logic del server)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| codice condiviso di QuakeC (librerie, sistemi)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| lo script per compilare i programmi del lato client dentro a '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| lo script per compilare i programmi del menù dentro a '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| lo script per compilare i programmi di gioco dentro a '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| compilatore sorgente di FTEQCC per QuakeC
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| Scanner dei sorgenti - un tool per creare le definizioni delle entità dell'editor di livelli (mapeditor/kain.game/kain/entities.ent) dal sorgente di QuakeC.
|}
&lt;/div&gt;

==Miscellanea==
Tutti gli altri file sono conenuti nella cartella '''misc/''', in cui possono esserci molte sottocartelle tra le quali qui nominiamo solo le più utili.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| documentazione varia sul gioco originale, i testi dei dialoghi, l'elenco dei danni delle armi ecc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| tutta la concept art realizzata per Blood Omnicide
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| vari file grafici non utilizzati per il gioco (loghi, icone, design del sito ecc.)
|}
&lt;/div&gt;


{{initalian|Struttura del repositorio nel dettaglio}}
{{capitolo successivo|}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Il motore grafico DarkPlaces</title>
    <ns>0</ns>
    <id>651</id>
      <sha1>b41nfz1wlfasaill1iznf9jteuboeb4</sha1>
    <revision>
      <id>3618</id>
      <timestamp>2013-03-23T18:27:28Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;[[File:Darkplaces logo.png|alt=|link=|right]] Il motore grafico di gioco DarkPlaces è il risultato di più di 10 anni di studi e sviluppo nel campo delle teconologie grafiche...&quot;</comment>
      <text xml:space="preserve" bytes="7519">[[File:Darkplaces logo.png|alt=|link=|right]]
Il motore grafico di gioco DarkPlaces è il risultato di più di 10 anni di studi e sviluppo nel campo delle teconologie grafiche per giochi in tempo reale fatti da Forest &quot;LordHavoc&quot; Hale e Rudolf &quot;divVerent&quot; Polzer. 

Basata sulla tecnologia di Quake di id Software, il motore di gioco DarkPlaces è uno degli ambienti 3D più solidi e affidabili disponibili. Permette di liberare il proprio potenziale creativo virtualmente a costo zero. Essendo un motore di gioco 3D open source e registrato come licenza GPL, è sufficiente citare il creatore e rendere pubbliche le correzioni e le aggiunte che eventualmente si ha realizzato nell'ambito della propria applicazione o gioco.

==Panoramica delle caratteristiche==
Questa è una lista approssimativa delle caratteristiche, scritta da Forest &quot;LordHavoc&quot; Hale.

'''&lt;font size=3&gt;Caratteristiche di base&lt;/font&gt;'''
* Piattaforme supportate: '''Windows''', '''Mac OS X''', '''Linux'''
* Piattaforme future: '''iOS''', '''Android (in sviluppo)'''.
* Ottimizzazioni SIMD: '''SSE''', '''SSE2'''.
* Supporto per sistemi a 32 e 64 bit di Windows, Mac OS X e Linux.
* Strumenti numerici e di debugging per il monitoraggio dell'utilizzo della memoria, delle texture, dei modelli e di altre componenti.
* Sistema completamente automatico di salvataggio e ripristino di gioco come parte della Macchina virtuale QuakeC.
* Caricamento di archivi zip compressi e download automatici tramite la libreria cURL.
* Generazione come hash di un BlindID user per le leaderboard online.

'''&lt;font size=3&gt;Renderer&lt;/font&gt;'''
* API supportate: Direct3D 9 Shader Model 3 (in sviluppo), OpenGL (tutte le versioni), OpenGL ES 2.0 e rasterizzazione software.
* Un'ampia gamma di opzioni di performance e regolazione permette al renderer di lavorare con schede video molto vecchie e molto nuove.
* Rendering con colore HDR a 64 bit.
* Anti-aliasing e coverage sampling.
* Rendering OpenGL Quad-Buffer Stereo 3D.
* Compatibilità NVIDIA 3D Vision / NVIDIA Surround / NVIDIA 3D Vision Surround (solo Direct3D 9).
* Compatibilità NVIDIA SLI.
* Compatibilità AMD CrossFire.
* Per-pixel lighting dinamica con shadowmap o stencil shadow volume.
* Illuminazione globale photon-mapping (statica o dinamica).
* Lightmap compilate con strumenti per bump e specular.
* Normal mapping e Specular mapping con per-pixel hardness.
* Offsetmapping e Reliefmapping.
* Tonemapping sRGB.
* Deferred lighting (in sviluppo).
* Texture glow.
* Supporto per gli &quot;shader&quot; di Quake 3 Arena.
* Particle system personalizzabile (sia file effectinfo che scripting QuakeC).
* Motion blur.
* Riflessi cubemap negli ambienti con normal map.
* Riflessi dinamici dell'acqua e effetti di distorsione e fattore Fresnel.
* Decal system con supporto per modelli animati.
* Supporto ai livelli bsp di Quake e Quake 3 Arena.
* Formati supportati di modelli-scheletro: '''IQM''' (consigliato), '''DPM''' (compilato da file SMD di HL2 o file MD5 di Doom 3), '''PSK/PSA''' di Unreal.
* Modelli non scheletro: '''MDL di Quake''', '''MD2 di Quake 2''', '''[[Portal:InItalian/MD3|MD3]] di Quake 3''', OBJ.
* Texture: [[Portal:InItalian/DDS|DDS]], [[Portal:InItalian/TGA|TGA]], PNG, JPG, PCX.

'''&lt;font size=3&gt;Fisica&lt;/font&gt;'''
* Open Dynamics Engine per simulazioni fisiche in tempo reale di rigid bodies, cloth (in sviluppo), ragdoll (in sviluppo).
* Fisica interna di Quake con engine per le collisioni ad alta-performance (collisioni swept-box e supporto trimesh, tecnologia di culling [[BIH | Bounding Interval Hierarchy]]).

'''&lt;font size=3&gt;Scripting&lt;/font&gt;'''
* Il potente e ad alto rendimento linguaggio di scripting  QuakeC (simile a C nella sintassi) supporta il server side, il client side e GUI scripting per i menù. Strumenti come il Portal rendering (interni), il sitema Model Level of Detail (LOD), clutter object, impostor, seamless world, AI avanzata, GUI in-game avanzata, livelli generati in modo procedurale e molti altri  possono essere ottenuti interamente mediante script.
* Macchina virtuale con salvataggi e ripristini di stato completi e il lavoro in rete come caratteristiche di base.
* QuakeC supporta testi localizzati per più lingue, e l'accesso automatico alle variabili della console.
* Graphic User Interface
* Supporto a font TTF e OTF (usando una libreria FreeType).
* Supporto Unicode (UTF8).
* Supporto integrato per file di traduzione standard .po per la localizzazione dei testi.
* Creazione avanzata di menù e GUI in-game tramite QuakeC.

'''&lt;font size=3&gt;Audio&lt;/font&gt;'''
* OGG Vorbis (sia per i suoni che per la musica),riproduzione di WAV e CD Audio.
* Effetti doppler e pitch shifting (realizzabili tramite script QuakeC).

'''&lt;font size=3&gt;Sistemi di input&lt;/font&gt;'''
* Tastiere e mouse PC/Mac.
* Gamepad Xbox 360.
* Joystick standard per PC e gamepad.
* Schermi multi-touch (in sviluppo).

'''&lt;font size=3&gt;Network&lt;/font&gt;'''
* Protocollo network avanzato con un sistema di priorità basato sulla distanza che permette di visualizzare migliaia di entità contemporaneamente.
* Il codice QuakeC può fornire un network personalizzato per un uso e una previsione ancora più ottimali della banda di rete.
* Download automatici di archivi zip tramite la libreria CURL come specificato dal server di gioco.
* Download automatico del codice QuakeC del client-side quando si gioca su server modificati.
* Recupero traceline del server-side per bloccare cheat di tipo wallhack.

'''&lt;font size=3&gt;Tool&lt;/font&gt;'''
* Compatibile con l'editor di livelli NetRadiant.
* Blender e altri programmi di modellazione hanno diversi modi per immettere materiale nel motore (IQM, SMD dagli esportatori per HL2, file PSK/PSA di Urneal, anche mesh md5 con animazioni possono essere convertite).

==Community==
* [http://quakeone.com/ QuakeOne] - Portale di Quake 1 Resurrection
* [http://www.inside3d.com/ Inside3D] - Portale più attivo di sviluppatori di Quake dedicato a mod e a codice QuakeC

==Giochi==
'''Giochi gratuiti'''
* [http://www.xonotic.org/ Xonotic] - Frenetico FPS multiplayer
* [http://www.alientrap.org/nexuiz/ Nexuiz Classic] - Predecessore di Xonotic
'''Giochi in vendita'''
* [http://www.retroblazer.com/ Retro Blazer] - FPS che ricorda e celebra i vecchi sparatutto, come Doom e Quake
* [http://www.steel-storm.com/ Steel Storm] - Sparatutto arcade con visuale dall'alto pubblicato su Steam
* [http://tom.kot-in-action.com/ Tomes of Mephistopheles] - Dungeon crawl a tema medievale

'''Immagini'''
&lt;gallery&gt;
File:Darkplaces xonotic.jpg|Xonotic
File:Darkplaces blood omnicide.jpg|Blood Omnicide
File:Darkplaces arcade quake.jpg|Arcade Quake - videogioco a piattaforme in 2D
File:Darkplaces nexuiz.jpg|Nexuiz Classic
File:Darkplaces tomes of mephistopheles.jpg|Tomes of Mephistopheles
File:Darkplaces custom1.jpg|Qualche mappa personalizzata
File:Darkplaces quake.png|Quake con texture ad alta risoluzzione
File:Darkplaces e1m1 retextured.jpg|E1M1 ritexturizzato
File:Darkplaces darsana.jpg|Darsana - gioco multiplayer a trama medievale
File:Darkplaces retro blazer.jpg|Retro Blazer
File:Darkplaces stealer guy.jpg|Stealer Guy
File:Darkplaces steel storm.jpg|Steel Storm
File:Darkplaces transfusion.jpg|Transfusion - remake del gioco 'Blood'
File:Darkplaces the hunted.jpg|The Hunted - gioco amatoriale di zombie
File:Darkplaces honeycomb.jpg|Honeycomb - un livello amatoriale di Quake
File:Darkplaces wraith.jpg|Il mostro Wraith ritexturizzato
&lt;/gallery&gt;

[[Category:InItalian/Motore_grafico_DarkPlaces]]
{{initalian|Il motore grafico DarkPlaces}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Il team di sviluppo</title>
    <ns>0</ns>
    <id>597</id>
      <sha1>sdgtruix9tiv0couw3l0llxremo7yr7</sha1>
    <revision>
      <id>3361</id>
      <timestamp>2013-01-20T12:45:34Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{WIP}} {{TOCRIGHT}} Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato. ==I principi==  =====Perché partecipare?===== :Il team di...&quot;</comment>
      <text xml:space="preserve" bytes="7326">{{WIP}}
{{TOCRIGHT}}
Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato.
==I principi==

=====Perché partecipare?=====
:Il team di Blood Omnicide esiste unicamente per garantire lo sviluppo di Blood Omnicide. Possono esserci varie motivazioni personali per prendere parte al progetto e contribuire, ma bisogna sempre seguire lo scopo principale - sviluppare Blood Omnicide con la massima qualità possibile.

=====Il core team dirige il lavoro=====
:In un progetto gestito dalla community, come Blood Omnicide, ci sono continuamente persone che si uniscono e persone che lasciano il team.
:Per poter mantenere un ordine delle cose esiste un &quot;team principale&quot;, il core team, formato dai membri più coinvolti che organizzano, prendono le decisioni e garantiscono un supporto a lungo termine; c'è poi un &quot;team di sostegno&quot;, il cover team, che si occupa di fornire supporto a breve termine.

=====L'importanza del cover team=====
:È facile pensare che i membri del core team siano &quot;il team&quot;, dato che hanno una maggiore visibilità degli altri membri. I membri del core team hanno le maggiori capacità, passione e conoscenze, ma non si arriverebbe a nulla di concreto senza il cover team. In altre parole, un gruppo di tre persone non può far procedere significativamente il progetto, per quanto bravo possa essere.

=====Internazionalità=====
:Il team di Blood Omnicide è composto da persone che vivono in paesi diversi; di conseguenza, sono possibili ben poche comunicazioni tra i membri del team. Per tenere tutto sincronizzato, il flusso di informazioni sul lavoro fatto è tutto concentrato in [[Repository Reference|SVN repository]]. Ogni modifica aggiorna il server, e ogni membro del team può controllare i risultati del lavoro degli altri. La copia in locale dei dati è la fonte principale di ispirazione e di informazioni su quello che si sta facendo.

=====Evoluzione da prodotto di nicchia a prodotto diffuso=====
:Blood Omnicide non cerca di essere più che un prodotto di nicchia. Ad ogni modo, cambiamenti che contribuiscono a renderlo noto a un maggiore pubblico sono ben accetti, a patto che non entrino in contrasto con lo spirito del progetto. Esempi di cambiamenti accettati: localizzazione in più lingue, un maggior numero di piattaforme che lo supportano...

==Il manuale del team==

'''1. Amplia, non sostituire'''
:Blood Omnicide è un progetto volto a trasporre Blood Omen in 3D. Le aggiunte dovrebbero essere al minimo, la fedeltà e il rispetto per l'originale al massimo. Se qualcosa va bene così com'è non c'è motivo di cambiarla.
:Le uniche eccezioni sono le trasformazioni da 2D a 3D e il principio d'evoluzione, secondo cui è permesso apportare modifiche al gameplay per ottenere la miglior esperienza di gioco possibile.

'''2. Un accurato rifacimento'''
:Trasformare in 3D significa ricreare molte cose utilizzando nuovi script e nuovi mezzi. Il principio fondamentale del rifacimento è l'attento studio dell'originale per scoprire su quali basi era stato realizzato. Sarebbe meglio attenersi a (ma non solo): bilanciamento, proporzioni, colori, ispirazione, inventiva e collegamenti con il resto del mondo di gioco.

'''3. Concentrati sugli elementi più deboli'''
:La qualità del progetto è direttamente proporzionale alla qualità dei suoi elementi più deboli. Per ottenere il progresso massimo è meglio lavorare sulle cose che ne hanno più bisogno.

'''4. Continui miglioramenti, anche nei dettagli minimi'''
:I dettagli sono la chiave della qualità. Ed è sempre un bene cercare di aggiungere profondità e di eliminare le complessità inutili.

'''5. Modifiche ai file: compila il registro dei commit'''
:È d'aiuto agli altri membri per capire in che direzione si sta muovendo il progetto.

'''6. Spezza i compiti maggiori in più compiti minori'''
:Cercare di completare qualcosa di piccolo è più facile e più verificabile.

'''7. Segui il piano'''
:Non cominciare un lavoro se non hai un piano e una visione globale di quello che devi fare.

'''8. Sii aperto alle collaborazioni'''
:Sii aperto all'aiuto che gli altri membri possono offrirti.

'''9. Diffondi e compila la lista delle poposte e dei bug'''
:Quasi tutto quello che viene creato ha aspetti positivi e aspetti negativi. Diffondere le opinioni degli altri è d'aiuto per avere una visione più chiara.

'''10. Se non sai come fare una cosa chiedilo agli altri membri'''
:Un particolare vantaggio del fare un piano è che si sa già cosa servirà per finire il lavoro, e in particolare cosa si dovrà imparare per potersi attenere al piano. 
:È impossibile formalizzare e documentare ogni singola informazione. È molto probabile che alcune informazioni sul progetto in corso non sono documentate affatto. Quindi, è sempre bene comunicare con gli altri per avere le idee più chiare.'''

'''11. Sì alle critiche, se costruttive'''
:Non è una brutta cosa criticare un lavoro fatto, ma bisogna basarsi su un'osservazione valida. Le critiche senza spiegazioni precise non sono di alcun aiuto.

'''12. Informati su cosa si sta facendo'''
:Sapere su cosa stanno lavorando gli altri membi è fondamentale per capire come si sta sviluppando il progetto e, quindi, per capire il miglior modo di procedere. Sarebbe meglio che tutti i membri del team sapessero ogni cosa che viene fatta. Comunicare con gli altri, leggere il registro dei commit e controllare le modifiche alle pagine della Wiki sono validi metodi per mantenersi aggiornati.

==I membri del team==

Questa è una lista prettamente funzionale dei membri del team. Una versione completa sarà disponibile al momento dell'uscita del prodotto.

===Core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===Modellazione 3D===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===Artwork e concept art generali===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Schizzi / concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Progetto Bloody Sounds===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Team di supporto per le localizzazioni===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Controllo del gameplay===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Texturing / aiuti artistici aggiuntivi===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces Engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Engine di gioco e tool===
* Il team della [[Darkplaces engine|Darkplaces Engine]] e tutti quelli che hanno contribuito
* Randy 'Ydnar' Reddig e tutti quelli che hanno contribuito a Q3map2
* Il team di GtkRadiant e tutti quelli che hanno contribuito
* MisterGrim

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3364</id>
      <timestamp>2013-01-20T13:30:34Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="7360">{{WIP}}
{{TOCRIGHT}}
Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato.
==I principi==

=====Perché partecipare?=====
:Il team di Blood Omnicide esiste unicamente per garantire lo sviluppo di Blood Omnicide. Possono esserci varie motivazioni personali per prendere parte al progetto e contribuire, ma bisogna sempre seguire lo scopo principale - sviluppare Blood Omnicide con la massima qualità possibile.

=====Il core team dirige il lavoro=====
:In un progetto gestito dalla community, come Blood Omnicide, ci sono continuamente persone che si uniscono e persone che lasciano il team.
:Per poter mantenere un ordine delle cose esiste un &quot;team principale&quot;, il core team, formato dai membri più coinvolti che organizzano, prendono le decisioni e garantiscono un supporto a lungo termine; c'è poi un &quot;team di sostegno&quot;, il cover team, che si occupa di fornire supporto a breve termine.

=====L'importanza del cover team=====
:È facile pensare che i membri del core team siano &quot;il team&quot;, dato che hanno una maggiore visibilità degli altri membri. I membri del core team hanno le maggiori capacità, passione e conoscenze, ma non si arriverebbe a nulla di concreto senza il cover team. In altre parole, un gruppo di tre persone non può far procedere significativamente il progetto, per quanto bravo possa essere.

=====Internazionalità=====
:Il team di Blood Omnicide è composto da persone che vivono in paesi diversi; di conseguenza, sono possibili ben poche comunicazioni tra i membri del team. Per tenere tutto sincronizzato, il flusso di informazioni sul lavoro fatto è tutto concentrato in [[Repository Reference|SVN repository]]. Ogni modifica aggiorna il server, e ogni membro del team può controllare i risultati del lavoro degli altri. La copia in locale dei dati è la fonte principale di ispirazione e di informazioni su quello che si sta facendo.

=====Evoluzione da prodotto di nicchia a prodotto diffuso=====
:Blood Omnicide non cerca di essere più che un prodotto di nicchia. Ad ogni modo, cambiamenti che contribuiscono a renderlo noto a un maggiore pubblico sono ben accetti, a patto che non entrino in contrasto con lo spirito del progetto. Esempi di cambiamenti accettati: localizzazione in più lingue, un maggior numero di piattaforme che lo supportano...

==Il manuale del team==

'''1. Amplia, non sostituire'''
:Blood Omnicide è un progetto volto a trasporre Blood Omen in 3D. Le aggiunte dovrebbero essere al minimo, la fedeltà e il rispetto per l'originale al massimo. Se qualcosa va bene così com'è non c'è motivo di cambiarla.
:Le uniche eccezioni sono le trasformazioni da 2D a 3D e il principio d'evoluzione, secondo cui è permesso apportare modifiche al gameplay per ottenere la miglior esperienza di gioco possibile.

'''2. Un accurato rifacimento'''
:Trasformare in 3D significa ricreare molte cose utilizzando nuovi script e nuovi mezzi. Il principio fondamentale del rifacimento è l'attento studio dell'originale per scoprire su quali basi era stato realizzato. Sarebbe meglio attenersi a (ma non solo): bilanciamento, proporzioni, colori, ispirazione, inventiva e collegamenti con il resto del mondo di gioco.

'''3. Concentrati sugli elementi più deboli'''
:La qualità del progetto è direttamente proporzionale alla qualità dei suoi elementi più deboli. Per ottenere il progresso massimo è meglio lavorare sulle cose che ne hanno più bisogno.

'''4. Continui miglioramenti, anche nei dettagli minimi'''
:I dettagli sono la chiave della qualità. Ed è sempre un bene cercare di aggiungere profondità e di eliminare le complessità inutili.

'''5. Modifiche ai file: compila il registro dei commit'''
:È d'aiuto agli altri membri per capire in che direzione si sta muovendo il progetto.

'''6. Spezza i compiti maggiori in più compiti minori'''
:Cercare di completare qualcosa di piccolo è più facile e più verificabile.

'''7. Segui il piano'''
:Non cominciare un lavoro se non hai un piano e una visione globale di quello che devi fare.

'''8. Sii aperto alle collaborazioni'''
:Sii aperto all'aiuto che gli altri membri possono offrirti.

'''9. Diffondi e compila la lista delle poposte e dei bug'''
:Quasi tutto quello che viene creato ha aspetti positivi e aspetti negativi. Diffondere le opinioni degli altri è d'aiuto per avere una visione più chiara.

'''10. Se non sai come fare una cosa chiedilo agli altri membri'''
:Un particolare vantaggio del fare un piano è che si sa già cosa servirà per finire il lavoro, e in particolare cosa si dovrà imparare per potersi attenere al piano. 
:È impossibile formalizzare e documentare ogni singola informazione. È molto probabile che alcune informazioni sul progetto in corso non sono documentate affatto. Quindi, è sempre bene comunicare con gli altri per avere le idee più chiare.'''

'''11. Sì alle critiche, se costruttive'''
:Non è una brutta cosa criticare un lavoro fatto, ma bisogna basarsi su un'osservazione valida. Le critiche senza spiegazioni precise non sono di alcun aiuto.

'''12. Informati su cosa si sta facendo'''
:Sapere su cosa stanno lavorando gli altri membi è fondamentale per capire come si sta sviluppando il progetto e, quindi, per capire il miglior modo di procedere. Sarebbe meglio che tutti i membri del team sapessero ogni cosa che viene fatta. Comunicare con gli altri, leggere il registro dei commit e controllare le modifiche alle pagine della Wiki sono validi metodi per mantenersi aggiornati.

==I membri del team==

Questa è una lista prettamente funzionale dei membri del team. Una versione completa sarà disponibile al momento dell'uscita del prodotto.

===Core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===Modellazione 3D===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===Artwork e concept art generali===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Schizzi / concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Progetto Bloody Sounds===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Team di supporto per le localizzazioni===
* Lorenso Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Controllo del gameplay===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Texturing / aiuti artistici aggiuntivi===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces Engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Engine di gioco e tool===
* Il team della [[Darkplaces engine|Darkplaces Engine]] e tutti quelli che hanno contribuito
* Randy 'Ydnar' Reddig e tutti quelli che hanno contribuito a Q3map2
* Il team di GtkRadiant e tutti quelli che hanno contribuito
* MisterGrim

{{initalian|Il team di sviluppo}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3372</id>
      <timestamp>2013-01-20T14:41:35Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="7360">{{WIP}}
{{TOCRIGHT}}
Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato.
==I principi==

=====Perché partecipare?=====
:Il team di Blood Omnicide esiste unicamente per garantire lo sviluppo di Blood Omnicide. Possono esserci varie motivazioni personali per prendere parte al progetto e contribuire, ma bisogna sempre seguire lo scopo principale - sviluppare Blood Omnicide con la massima qualità possibile.

=====Il core team dirige il lavoro=====
:In un progetto gestito dalla community, come Blood Omnicide, ci sono continuamente persone che si uniscono e persone che lasciano il team.
:Per poter mantenere un ordine delle cose esiste un &quot;team principale&quot;, il core team, formato dai membri più coinvolti che organizzano, prendono le decisioni e garantiscono un supporto a lungo termine; c'è poi un &quot;team di sostegno&quot;, il cover team, che si occupa di fornire supporto a breve termine.

=====L'importanza del cover team=====
:È facile pensare che i membri del core team siano &quot;il team&quot;, dato che hanno una maggiore visibilità degli altri membri. I membri del core team hanno le maggiori capacità, passione e conoscenze, ma non si arriverebbe a nulla di concreto senza il cover team. In altre parole, un gruppo di tre persone non può far procedere significativamente il progetto, per quanto bravo possa essere.

=====Internazionalità=====
:Il team di Blood Omnicide è composto da persone che vivono in paesi diversi; di conseguenza, sono possibili ben poche comunicazioni tra i membri del team. Per tenere tutto sincronizzato, il flusso di informazioni sul lavoro fatto è tutto concentrato in [[Repository Reference|SVN repository]]. Ogni modifica aggiorna il server, e ogni membro del team può controllare i risultati del lavoro degli altri. La copia in locale dei dati è la fonte principale di ispirazione e di informazioni su quello che si sta facendo.

=====Evoluzione da prodotto di nicchia a prodotto diffuso=====
:Blood Omnicide non cerca di essere più che un prodotto di nicchia. Ad ogni modo, cambiamenti che contribuiscono a renderlo noto a un maggiore pubblico sono ben accetti, a patto che non entrino in contrasto con lo spirito del progetto. Esempi di cambiamenti accettati: localizzazione in più lingue, un maggior numero di piattaforme che lo supportano...

==Il manuale del team==

'''1. Amplia, non sostituire'''
:Blood Omnicide è un progetto volto a trasporre Blood Omen in 3D. Le aggiunte dovrebbero essere al minimo, la fedeltà e il rispetto per l'originale al massimo. Se qualcosa va bene così com'è non c'è motivo di cambiarla.
:Le uniche eccezioni sono le trasformazioni da 2D a 3D e il principio d'evoluzione, secondo cui è permesso apportare modifiche al gameplay per ottenere la miglior esperienza di gioco possibile.

'''2. Un accurato rifacimento'''
:Trasformare in 3D significa ricreare molte cose utilizzando nuovi script e nuovi mezzi. Il principio fondamentale del rifacimento è l'attento studio dell'originale per scoprire su quali basi era stato realizzato. Sarebbe meglio attenersi a (ma non solo): bilanciamento, proporzioni, colori, ispirazione, inventiva e collegamenti con il resto del mondo di gioco.

'''3. Concentrati sugli elementi più deboli'''
:La qualità del progetto è direttamente proporzionale alla qualità dei suoi elementi più deboli. Per ottenere il progresso massimo è meglio lavorare sulle cose che ne hanno più bisogno.

'''4. Continui miglioramenti, anche nei dettagli minimi'''
:I dettagli sono la chiave della qualità. Ed è sempre un bene cercare di aggiungere profondità e di eliminare le complessità inutili.

'''5. Modifiche ai file: compila il registro dei commit'''
:È d'aiuto agli altri membri per capire in che direzione si sta muovendo il progetto.

'''6. Spezza i compiti maggiori in più compiti minori'''
:Cercare di completare qualcosa di piccolo è più facile e più verificabile.

'''7. Segui il piano'''
:Non cominciare un lavoro se non hai un piano e una visione globale di quello che devi fare.

'''8. Sii aperto alle collaborazioni'''
:Sii aperto all'aiuto che gli altri membri possono offrirti.

'''9. Diffondi e compila la lista delle poposte e dei bug'''
:Quasi tutto quello che viene creato ha aspetti positivi e aspetti negativi. Diffondere le opinioni degli altri è d'aiuto per avere una visione più chiara.

'''10. Se non sai come fare una cosa chiedilo agli altri membri'''
:Un particolare vantaggio del fare un piano è che si sa già cosa servirà per finire il lavoro, e in particolare cosa si dovrà imparare per potersi attenere al piano. 
:È impossibile formalizzare e documentare ogni singola informazione. È molto probabile che alcune informazioni sul progetto in corso non sono documentate affatto. Quindi, è sempre bene comunicare con gli altri per avere le idee più chiare.'''

'''11. Sì alle critiche, se costruttive'''
:Non è una brutta cosa criticare un lavoro fatto, ma bisogna basarsi su un'osservazione valida. Le critiche senza spiegazioni precise non sono di alcun aiuto.

'''12. Informati su cosa si sta facendo'''
:Sapere su cosa stanno lavorando gli altri membi è fondamentale per capire come si sta sviluppando il progetto e, quindi, per capire il miglior modo di procedere. Sarebbe meglio che tutti i membri del team sapessero ogni cosa che viene fatta. Comunicare con gli altri, leggere il registro dei commit e controllare le modifiche alle pagine della Wiki sono validi metodi per mantenersi aggiornati.

==I membri del team==

Questa è una lista prettamente funzionale dei membri del team. Una versione completa sarà disponibile al momento dell'uscita del prodotto.

===Core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===Modellazione 3D===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===Artwork e concept art generali===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Schizzi / concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Progetto Bloody Sounds===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Team di supporto per le localizzazioni===
* Lorenzo Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Controllo del gameplay===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Texturing / aiuti artistici aggiuntivi===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces Engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Engine di gioco e tool===
* Il team della [[Darkplaces engine|Darkplaces Engine]] e tutti quelli che hanno contribuito
* Randy 'Ydnar' Reddig e tutti quelli che hanno contribuito a Q3map2
* Il team di GtkRadiant e tutti quelli che hanno contribuito
* MisterGrim

{{initalian|Il team di sviluppo}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3499</id>
      <timestamp>2013-01-24T13:27:00Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="7389">{{WIP}}
{{TOCRIGHT}}
Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato.
==I principi==

=====Perché partecipare?=====
:Il team di Blood Omnicide esiste unicamente per garantire lo sviluppo di Blood Omnicide. Possono esserci varie motivazioni personali per prendere parte al progetto e contribuire, ma bisogna sempre seguire lo scopo principale - sviluppare Blood Omnicide con la massima qualità possibile.

=====Il core team dirige il lavoro=====
:In un progetto gestito dalla community, come Blood Omnicide, ci sono continuamente persone che si uniscono e persone che lasciano il team.
:Per poter mantenere un ordine delle cose esiste un &quot;team principale&quot;, il core team, formato dai membri più coinvolti che organizzano, prendono le decisioni e garantiscono un supporto a lungo termine; c'è poi un &quot;team di sostegno&quot;, il cover team, che si occupa di fornire supporto a breve termine.

=====L'importanza del cover team=====
:È facile pensare che i membri del core team siano &quot;il team&quot;, dato che hanno una maggiore visibilità degli altri membri. I membri del core team hanno le maggiori capacità, passione e conoscenze, ma non si arriverebbe a nulla di concreto senza il cover team. In altre parole, un gruppo di tre persone non può far procedere significativamente il progetto, per quanto bravo possa essere.

=====Internazionalità=====
:Il team di Blood Omnicide è composto da persone che vivono in paesi diversi; di conseguenza, sono possibili ben poche comunicazioni tra i membri del team. Per tenere tutto sincronizzato, il flusso di informazioni sul lavoro fatto è tutto concentrato nel [[Portal:InItalian/Guida al repositorio di SVN|repositorio di SVN]]. Ogni modifica aggiorna il server, e ogni membro del team può controllare i risultati del lavoro degli altri. La copia in locale dei dati è la fonte principale di ispirazione e di informazioni su quello che si sta facendo.

=====Evoluzione da prodotto di nicchia a prodotto diffuso=====
:Blood Omnicide non cerca di essere più che un prodotto di nicchia. Ad ogni modo, cambiamenti che contribuiscono a renderlo noto a un maggiore pubblico sono ben accetti, a patto che non entrino in contrasto con lo spirito del progetto. Esempi di cambiamenti accettati: localizzazione in più lingue, un maggior numero di piattaforme che lo supportano...

==Il manuale del team==

'''1. Amplia, non sostituire'''
:Blood Omnicide è un progetto volto a trasporre Blood Omen in 3D. Le aggiunte dovrebbero essere al minimo, la fedeltà e il rispetto per l'originale al massimo. Se qualcosa va bene così com'è non c'è motivo di cambiarla.
:Le uniche eccezioni sono le trasformazioni da 2D a 3D e il principio d'evoluzione, secondo cui è permesso apportare modifiche al gameplay per ottenere la miglior esperienza di gioco possibile.

'''2. Un accurato rifacimento'''
:Trasformare in 3D significa ricreare molte cose utilizzando nuovi script e nuovi mezzi. Il principio fondamentale del rifacimento è l'attento studio dell'originale per scoprire su quali basi era stato realizzato. Sarebbe meglio attenersi a (ma non solo): bilanciamento, proporzioni, colori, ispirazione, inventiva e collegamenti con il resto del mondo di gioco.

'''3. Concentrati sugli elementi più deboli'''
:La qualità del progetto è direttamente proporzionale alla qualità dei suoi elementi più deboli. Per ottenere il progresso massimo è meglio lavorare sulle cose che ne hanno più bisogno.

'''4. Continui miglioramenti, anche nei dettagli minimi'''
:I dettagli sono la chiave della qualità. Ed è sempre un bene cercare di aggiungere profondità e di eliminare le complessità inutili.

'''5. Modifiche ai file: compila il registro dei commit'''
:È d'aiuto agli altri membri per capire in che direzione si sta muovendo il progetto.

'''6. Spezza i compiti maggiori in più compiti minori'''
:Cercare di completare qualcosa di piccolo è più facile e più verificabile.

'''7. Segui il piano'''
:Non cominciare un lavoro se non hai un piano e una visione globale di quello che devi fare.

'''8. Sii aperto alle collaborazioni'''
:Sii aperto all'aiuto che gli altri membri possono offrirti.

'''9. Diffondi e compila la lista delle poposte e dei bug'''
:Quasi tutto quello che viene creato ha aspetti positivi e aspetti negativi. Diffondere le opinioni degli altri è d'aiuto per avere una visione più chiara.

'''10. Se non sai come fare una cosa chiedilo agli altri membri'''
:Un particolare vantaggio del fare un piano è che si sa già cosa servirà per finire il lavoro, e in particolare cosa si dovrà imparare per potersi attenere al piano. 
:È impossibile formalizzare e documentare ogni singola informazione. È molto probabile che alcune informazioni sul progetto in corso non sono documentate affatto. Quindi, è sempre bene comunicare con gli altri per avere le idee più chiare.'''

'''11. Sì alle critiche, se costruttive'''
:Non è una brutta cosa criticare un lavoro fatto, ma bisogna basarsi su un'osservazione valida. Le critiche senza spiegazioni precise non sono di alcun aiuto.

'''12. Informati su cosa si sta facendo'''
:Sapere su cosa stanno lavorando gli altri membi è fondamentale per capire come si sta sviluppando il progetto e, quindi, per capire il miglior modo di procedere. Sarebbe meglio che tutti i membri del team sapessero ogni cosa che viene fatta. Comunicare con gli altri, leggere il registro dei commit e controllare le modifiche alle pagine della Wiki sono validi metodi per mantenersi aggiornati.

==I membri del team==

Questa è una lista prettamente funzionale dei membri del team. Una versione completa sarà disponibile al momento dell'uscita del prodotto.

===Core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===Modellazione 3D===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===Artwork e concept art generali===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Schizzi / concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Progetto Bloody Sounds===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Team di supporto per le localizzazioni===
* Lorenzo Forini (TraductionProduction) - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Controllo del gameplay===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Texturing / aiuti artistici aggiuntivi===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces Engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Engine di gioco e tool===
* Il team della [[Darkplaces engine|Darkplaces Engine]] e tutti quelli che hanno contribuito
* Randy 'Ydnar' Reddig e tutti quelli che hanno contribuito a Q3map2
* Il team di GtkRadiant e tutti quelli che hanno contribuito
* MisterGrim

{{initalian|Il team di sviluppo}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3598</id>
      <timestamp>2013-02-17T12:33:30Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="7407">{{WIP}}
{{TOCRIGHT}}
Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato.
==I principi==

=====Perché partecipare?=====
:Il team di Blood Omnicide esiste unicamente per garantire lo sviluppo di Blood Omnicide. Possono esserci varie motivazioni personali per prendere parte al progetto e contribuire, ma bisogna sempre seguire lo scopo principale - sviluppare Blood Omnicide con la massima qualità possibile.

=====Il core team dirige il lavoro=====
:In un progetto gestito dalla community, come Blood Omnicide, ci sono continuamente persone che si uniscono e persone che lasciano il team.
:Per poter mantenere un ordine delle cose esiste un &quot;team principale&quot;, il core team, formato dai membri più coinvolti che organizzano, prendono le decisioni e garantiscono un supporto a lungo termine; c'è poi un &quot;team di sostegno&quot;, il cover team, che si occupa di fornire supporto a breve termine.

=====L'importanza del cover team=====
:È facile pensare che i membri del core team siano &quot;il team&quot;, dato che hanno una maggiore visibilità degli altri membri. I membri del core team hanno le maggiori capacità, passione e conoscenze, ma non si arriverebbe a nulla di concreto senza il cover team. In altre parole, un gruppo di tre persone non può far procedere significativamente il progetto, per quanto bravo possa essere.

=====Internazionalità=====
:Il team di Blood Omnicide è composto da persone che vivono in paesi diversi; di conseguenza, sono possibili ben poche comunicazioni tra i membri del team. Per tenere tutto sincronizzato, il flusso di informazioni sul lavoro fatto è tutto concentrato nel [[Portal:InItalian/Guida al repositorio di SVN|repositorio di SVN]]. Ogni modifica aggiorna il server, e ogni membro del team può controllare i risultati del lavoro degli altri. La copia in locale dei dati è la fonte principale di ispirazione e di informazioni su quello che si sta facendo.

=====Evoluzione da prodotto di nicchia a prodotto diffuso=====
:Blood Omnicide non cerca di essere più che un prodotto di nicchia. Ad ogni modo, cambiamenti che contribuiscono a renderlo noto a un maggiore pubblico sono ben accetti, a patto che non entrino in contrasto con lo spirito del progetto. Esempi di cambiamenti accettati: localizzazione in più lingue, un maggior numero di piattaforme che lo supportano...

==Il manuale del team==

'''1. Amplia, non sostituire'''
:Blood Omnicide è un progetto volto a trasporre Blood Omen in 3D. Le aggiunte dovrebbero essere al minimo, la fedeltà e il rispetto per l'originale al massimo. Se qualcosa va bene così com'è non c'è motivo di cambiarla.
:Le uniche eccezioni sono le trasformazioni da 2D a 3D e il principio d'evoluzione, secondo cui è permesso apportare modifiche al gameplay per ottenere la miglior esperienza di gioco possibile.

'''2. Un accurato rifacimento'''
:Trasformare in 3D significa ricreare molte cose utilizzando nuovi script e nuovi mezzi. Il principio fondamentale del rifacimento è l'attento studio dell'originale per scoprire su quali basi era stato realizzato. Sarebbe meglio attenersi a (ma non solo): bilanciamento, proporzioni, colori, ispirazione, inventiva e collegamenti con il resto del mondo di gioco.

'''3. Concentrati sugli elementi più deboli'''
:La qualità del progetto è direttamente proporzionale alla qualità dei suoi elementi più deboli. Per ottenere il progresso massimo è meglio lavorare sulle cose che ne hanno più bisogno.

'''4. Continui miglioramenti, anche nei dettagli minimi'''
:I dettagli sono la chiave della qualità. Ed è sempre un bene cercare di aggiungere profondità e di eliminare le complessità inutili.

'''5. Modifiche ai file: compila il registro dei commit'''
:È d'aiuto agli altri membri per capire in che direzione si sta muovendo il progetto.

'''6. Spezza i compiti maggiori in più compiti minori'''
:Cercare di completare qualcosa di piccolo è più facile e più verificabile.

'''7. Segui il piano'''
:Non cominciare un lavoro se non hai un piano e una visione globale di quello che devi fare.

'''8. Sii aperto alle collaborazioni'''
:Sii aperto all'aiuto che gli altri membri possono offrirti.

'''9. Diffondi e compila la lista delle poposte e dei bug'''
:Quasi tutto quello che viene creato ha aspetti positivi e aspetti negativi. Diffondere le opinioni degli altri è d'aiuto per avere una visione più chiara.

'''10. Se non sai come fare una cosa chiedilo agli altri membri'''
:Un particolare vantaggio del fare un piano è che si sa già cosa servirà per finire il lavoro, e in particolare cosa si dovrà imparare per potersi attenere al piano. 
:È impossibile formalizzare e documentare ogni singola informazione. È molto probabile che alcune informazioni sul progetto in corso non sono documentate affatto. Quindi, è sempre bene comunicare con gli altri per avere le idee più chiare.'''

'''11. Sì alle critiche, se costruttive'''
:Non è una brutta cosa criticare un lavoro fatto, ma bisogna basarsi su un'osservazione valida. Le critiche senza spiegazioni precise non sono di alcun aiuto.

'''12. Informati su cosa si sta facendo'''
:Sapere su cosa stanno lavorando gli altri membi è fondamentale per capire come si sta sviluppando il progetto e, quindi, per capire il miglior modo di procedere. Sarebbe meglio che tutti i membri del team sapessero ogni cosa che viene fatta. Comunicare con gli altri, leggere il registro dei commit e controllare le modifiche alle pagine della Wiki sono validi metodi per mantenersi aggiornati.

==I membri del team==

Questa è una lista prettamente funzionale dei membri del team. Una versione completa sarà disponibile al momento dell'uscita del prodotto.

===Core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===Modellazione 3D===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===Artwork e concept art generali===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Schizzi / concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Progetto Bloody Sounds===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Team di supporto per le localizzazioni===
* Lorenzo Forini (TraductionProduction), Giorgio Di Nucci - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Controllo del gameplay===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Texturing / aiuti artistici aggiuntivi===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces Engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Engine di gioco e tool===
* Il team della [[Darkplaces engine|Darkplaces Engine]] e tutti quelli che hanno contribuito
* Randy 'Ydnar' Reddig e tutti quelli che hanno contribuito a Q3map2
* Il team di GtkRadiant e tutti quelli che hanno contribuito
* MisterGrim

{{initalian|Il team di sviluppo}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3601</id>
      <timestamp>2013-02-17T21:57:17Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="7417">{{WIP}}
{{TOCRIGHT}}
Questo articolo spiega le regole e i principi secondo cui il team di Blood Omnicide è formato.
==I principi==

=====Perché partecipare?=====
:Il team di Blood Omnicide esiste unicamente per garantire lo sviluppo di Blood Omnicide. Possono esserci varie motivazioni personali per prendere parte al progetto e contribuire, ma bisogna sempre seguire lo scopo principale - sviluppare Blood Omnicide con la massima qualità possibile.

=====Il core team dirige il lavoro=====
:In un progetto gestito dalla community, come Blood Omnicide, ci sono continuamente persone che si uniscono e persone che lasciano il team.
:Per poter mantenere un ordine delle cose esiste un &quot;team principale&quot;, il core team, formato dai membri più coinvolti che organizzano, prendono le decisioni e garantiscono un supporto a lungo termine; c'è poi un &quot;team di sostegno&quot;, il cover team, che si occupa di fornire supporto a breve termine.

=====L'importanza del cover team=====
:È facile pensare che i membri del core team siano &quot;il team&quot;, dato che hanno una maggiore visibilità degli altri membri. I membri del core team hanno le maggiori capacità, passione e conoscenze, ma non si arriverebbe a nulla di concreto senza il cover team. In altre parole, un gruppo di tre persone non può far procedere significativamente il progetto, per quanto bravo possa essere.

=====Internazionalità=====
:Il team di Blood Omnicide è composto da persone che vivono in paesi diversi; di conseguenza, sono possibili ben poche comunicazioni tra i membri del team. Per tenere tutto sincronizzato, il flusso di informazioni sul lavoro fatto è tutto concentrato nel [[Portal:InItalian/Guida al repositorio di SVN|repositorio di SVN]]. Ogni modifica aggiorna il server, e ogni membro del team può controllare i risultati del lavoro degli altri. La copia in locale dei dati è la fonte principale di ispirazione e di informazioni su quello che si sta facendo.

=====Evoluzione da prodotto di nicchia a prodotto diffuso=====
:Blood Omnicide non cerca di essere più che un prodotto di nicchia. Ad ogni modo, cambiamenti che contribuiscono a renderlo noto a un maggiore pubblico sono ben accetti, a patto che non entrino in contrasto con lo spirito del progetto. Esempi di cambiamenti accettati: localizzazione in più lingue, un maggior numero di piattaforme che lo supportano...

==Il manuale del team==

'''1. Amplia, non sostituire'''
:Blood Omnicide è un progetto volto a trasporre Blood Omen in 3D. Le aggiunte dovrebbero essere al minimo, la fedeltà e il rispetto per l'originale al massimo. Se qualcosa va bene così com'è non c'è motivo di cambiarla.
:Le uniche eccezioni sono le trasformazioni da 2D a 3D e il principio d'evoluzione, secondo cui è permesso apportare modifiche al gameplay per ottenere la miglior esperienza di gioco possibile.

'''2. Un accurato rifacimento'''
:Trasformare in 3D significa ricreare molte cose utilizzando nuovi script e nuovi mezzi. Il principio fondamentale del rifacimento è l'attento studio dell'originale per scoprire su quali basi era stato realizzato. Sarebbe meglio attenersi a (ma non solo): bilanciamento, proporzioni, colori, ispirazione, inventiva e collegamenti con il resto del mondo di gioco.

'''3. Concentrati sugli elementi più deboli'''
:La qualità del progetto è direttamente proporzionale alla qualità dei suoi elementi più deboli. Per ottenere il progresso massimo è meglio lavorare sulle cose che ne hanno più bisogno.

'''4. Continui miglioramenti, anche nei dettagli minimi'''
:I dettagli sono la chiave della qualità. Ed è sempre un bene cercare di aggiungere profondità e di eliminare le complessità inutili.

'''5. Modifiche ai file: compila il registro dei commit'''
:È d'aiuto agli altri membri per capire in che direzione si sta muovendo il progetto.

'''6. Spezza i compiti maggiori in più compiti minori'''
:Cercare di completare qualcosa di piccolo è più facile e più verificabile.

'''7. Segui il piano'''
:Non cominciare un lavoro se non hai un piano e una visione globale di quello che devi fare.

'''8. Sii aperto alle collaborazioni'''
:Sii aperto all'aiuto che gli altri membri possono offrirti.

'''9. Diffondi e compila la lista delle poposte e dei bug'''
:Quasi tutto quello che viene creato ha aspetti positivi e aspetti negativi. Diffondere le opinioni degli altri è d'aiuto per avere una visione più chiara.

'''10. Se non sai come fare una cosa chiedilo agli altri membri'''
:Un particolare vantaggio del fare un piano è che si sa già cosa servirà per finire il lavoro, e in particolare cosa si dovrà imparare per potersi attenere al piano. 
:È impossibile formalizzare e documentare ogni singola informazione. È molto probabile che alcune informazioni sul progetto in corso non sono documentate affatto. Quindi, è sempre bene comunicare con gli altri per avere le idee più chiare.'''

'''11. Sì alle critiche, se costruttive'''
:Non è una brutta cosa criticare un lavoro fatto, ma bisogna basarsi su un'osservazione valida. Le critiche senza spiegazioni precise non sono di alcun aiuto.

'''12. Informati su cosa si sta facendo'''
:Sapere su cosa stanno lavorando gli altri membi è fondamentale per capire come si sta sviluppando il progetto e, quindi, per capire il miglior modo di procedere. Sarebbe meglio che tutti i membri del team sapessero ogni cosa che viene fatta. Comunicare con gli altri, leggere il registro dei commit e controllare le modifiche alle pagine della Wiki sono validi metodi per mantenersi aggiornati.

==I membri del team==

Questa è una lista prettamente funzionale dei membri del team. Una versione completa sarà disponibile al momento dell'uscita del prodotto.

===Core team===
* Pavel 'VorteX' Timofeyev
* Vitaliy 'Mean Person' Gron
* Yuriy 'Sidesman' Kudrinetskiy

===Modellazione 3D===
* Alexander 'Roland' Ugolkov
* Alexander 'Q`Linar' Stolbov
* Nikita 'Userdelete' Stadnik
* Pavel 'Norgant' Yefremov
* Sergey 'Mit' Selivyorstov
* Mike Cruz

===Artwork e concept art generali===
* [[:Category:Art by MAD|Alexandra 'Enigma' Melnikova]]
* [[:Category:Art by Adam Brown|Adam Brown]]

===Schizzi / concept art===
* [[:Category:Art by David Lakatos|David Lakatos]]
* [[:Category:Art by AmDDRed|AmDDRed]]
* [[:Category:Art by GamerXXL|GamerXXL]]
* [[:Category:Art by Hedgenok|Hedgenok]]
* Lidia Lada

===Progetto Bloody Sounds===
* Marcin 'Emandes' Szymczak
* Paranoid
* Evellnirt
* XVWawa
* Rockmedved

===Team di supporto per le localizzazioni===
* Lorenzo Forini (TraductionProduction), Giorgio 'Zelgius' Di Nucci - Italian translation pack
* Marcin Szymczak - Polish translation pack
* Pavel Timofeyev, Sidesman, Paranoid - Russian translation pack
* Alfonso Ruzafa - Spanish translation pack

===Controllo del gameplay===
* IvanSv
* Morenn
* SNiCS
* Bloodsteal

===Texturing / aiuti artistici aggiuntivi===
* Andrey 'Picasso' Shatalov
* Kevin 'Rorshach' Johnstone
* Timothy Andrew 'unDuLe' Wilson
* David Gurrea

===Darkplaces Engine===
* Forest 'LordHavoc' Hale
* Rudolf 'DivVerent' Polzer
* Mathieu 'Elric' Olivier
* Andreas 'Black' Kirsch
* Blub/0
* Eihrul

===Engine di gioco e tool===
* Il team della [[Darkplaces engine|Darkplaces Engine]] e tutti quelli che hanno contribuito
* Randy 'Ydnar' Reddig e tutti quelli che hanno contribuito a Q3map2
* Il team di GtkRadiant e tutti quelli che hanno contribuito
* MisterGrim

{{initalian|Il team di sviluppo}}
__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Lista completa delle caratteristiche</title>
    <ns>0</ns>
    <id>596</id>
      <sha1>0e1h13h25swqmjvy40lhk5e139ns1zv</sha1>
    <revision>
      <id>3358</id>
      <timestamp>2013-01-16T14:22:41Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;{{TOCRIGHT}} Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Ome...&quot;</comment>
      <text xml:space="preserve" bytes="4980">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola del &quot;estendi, non distruggere&quot;. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sotto la testa)'';
* ''Sottotitoli per i filmati'';
===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Bloody Sounds)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella Playstation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Lampo di Energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioccia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così me ne andai').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3360</id>
      <timestamp>2013-01-17T23:25:37Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="4983">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola del &quot;estendi, non distruggere&quot;. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sotto la testa)'';
* ''Sottotitoli per i filmati'';
===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Suoni Sanguinosi)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella Playstation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Lampo di Energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioccia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così me ne andai').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3368</id>
      <timestamp>2013-01-20T13:53:13Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="4982">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell'&quot;amplia, non sostituire&quot;. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sotto la testa)'';
* ''Sottotitoli per i filmati'';
===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Suoni Sanguinosi)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella Playstation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Lampo di Energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioccia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così me ne andai').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3369</id>
      <timestamp>2013-01-20T13:53:32Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="4984">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell'''amplia, non sostituire''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sotto la testa)'';
* ''Sottotitoli per i filmati'';
===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Suoni Sanguinosi)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella Playstation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Lampo di Energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioccia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così me ne andai').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3370</id>
      <timestamp>2013-01-20T13:53:45Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="4990">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell''''''amplia, non sostituire'''''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sotto la testa)'';
* ''Sottotitoli per i filmati'';
===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Suoni Sanguinosi)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella Playstation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Lampo di Energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioccia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così me ne andai').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3371</id>
      <timestamp>2013-01-20T14:06:46Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="4982">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell''''''amplia, non sostituire'''''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sotto la testa)'';
* ''Sottotitoli per i filmati'';
===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Bloody Sounds)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella PlayStation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Saetta di energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioggia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così uscii').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3556</id>
      <timestamp>2013-01-26T20:36:14Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Grafica */</comment>
      <text xml:space="preserve" bytes="4995">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell''''''amplia, non sostituire'''''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali e sulla testa dei personaggi)'';
* ''Sottotitoli per i filmati'';

===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Bloody Sounds)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella PlayStation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Saetta di energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioggia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così uscii').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3557</id>
      <timestamp>2013-01-26T20:36:22Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Grafica */</comment>
      <text xml:space="preserve" bytes="4995">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell''''''amplia, non sostituire'''''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali o sulla testa dei personaggi)'';
* ''Sottotitoli per i filmati'';

===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Bloody Sounds)'';
* Le musiche in mezzo ai livelli sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente, la musica non verrà riiniziata.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;
===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella PlayStation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Saetta di energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioggia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così uscii').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3558</id>
      <timestamp>2013-01-26T20:38:05Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Suono */</comment>
      <text xml:space="preserve" bytes="4994">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell''''''amplia, non sostituire'''''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali o sulla testa dei personaggi)'';
* ''Sottotitoli per i filmati'';

===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Bloody Sounds)'';
* Al passaggio di livello le musiche sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente la musica non ricomincerà.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;

===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella PlayStation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Saetta di energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori sono più lisci, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioggia, la gravità, tutto ciò che non è Kain;
===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così uscii').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3559</id>
      <timestamp>2013-01-26T20:40:19Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Cambiamenti nel combattimento */</comment>
      <text xml:space="preserve" bytes="5026">{{TOCRIGHT}}
Questa pagina contiene una lista grezza delle caratteristiche di gameplay che Blood Omnicide ha aggiunto o alterato a confronto con il gioco originale - Blood Omen: Legacy of Kain. Tutte le funzionalità sono aggiunte usando la regola dell''''''amplia, non sostituire'''''. E tutti i cambiamenti sono mirati a migliorare il gameplay in nuovi ambienti 3D. Le funzionalità opzionali sono marcate in grassetto. Tuttavia non tutte le funzionalità possono essere opzionali. Stiamo facendo un gioco, non un qualche sorta di costruttore.

Le funzionalità che non possono essere rese opzionali e rovinano l'atmosfera di gioco, saranno rimosse.

===Grafica===
* ''HUD modernizzato'';
* ''Stile delle mappe modernizzato'';
* ''Colore per la magia automatico o personalizzabile (l'automatico è in base alla sfera più grande raccolta)'';
* ''Sottotitoli per i dialoghi (normali o sulla testa dei personaggi)'';
* ''Sottotitoli per i filmati'';

===Suono===
* La spada di Kain emette suoni differenti a seconda del tipo di superficie che colpisce (es. un nemico, una parete, ecc.);
* ''Nuove tracce musicali: estese e moderne (nuove tracce e remix presi dal progetto Bloody Sounds)'';
* Al passaggio di livello le musiche sono a dissolvenza incrociata. Se nel livello successivo viene suonata la stessa traccia musicale del precedente la musica non ricomincerà.
* ''Suono dei passi'';
* Nuovi suoni dell'ambiente e dei combattimenti;

===Caratteristiche generali del gameplay===
* ''Velocità del gioco: normale (standard PC), veloce, più veloce (come nella PlayStation)'';
* Aggiunto l'effetto scia nelle armi da mischia.
* Il Nosgoth Blood Script ora può essere tradotto. Questo significa che lingue diverse possono avere diversi alfabeti runici.
* Alcuni contenuti segreti sono stati cambiati, quindi necessitano di essere cercati di nuovo;
* La telecamera è leggermente più in alto di Blood Omen;
===Nuove abilità basate su incantesimi/attacchi caricati tenendo premuto un tasto===
* Mira automatica per incantesimi e artefatti diretti in avanti (Saetta di energia, Implosione) - 15 gradi attorno la direzione dello sguardo (si attiva tenendo premuto il tasto dell'incantesimo per più di un secondo);
* La Mietitrice d'Anime può opzionalmente usare l'attacco normale (fa un danno leggermente maggiore della spada di ferro) se il tasto è premuto per meno di 0.5 secondi;
* I salti in forma di lupo sono più lunghi, possono arrivare molto lontano - premendo il tasto &quot;salta&quot; e il tasto direzionale corrispondente alla direzione allo stesso tempo;
* Gli attacchi con asce da lancio ora usano il &quot;misuratore di forza&quot;, che aumenta tanto più quante più volte è premuto ripetutamente il tasto dell'attacco. Per lanciare l'attacco &quot;turbine&quot; il giocatore deve premere 6 o più volte al secondo per due secondi, invece premendolo 2 o più volte al secondo verrà lanciata una serie di colpi (possono arrivare fino a 20-30 colpi);
===Cambiamenti nel combattimento===
* Attacchi con la spada più veloci;
* Attacchi con l'ascia più veloci;
* I nemici attaccano più velocemente;
* I Laceratori tornano indietro facendo un giro più omogeneo, inoltre l'artefatto può mancare il bersaglio in alcuni casi (quando il nemico esce fuori dal raggio d'azione del Laceratore e la velocità di questo è troppo alta per modificare la traiettoria);
* Sono ridotte di molto le risate di Kain e le urla &quot;Vae Victis&quot;;
* Gli incantesimi che rallentano il tempo ora hanno effetto su tutto il mondo attorno a Kain, non solo sui nemici. Questo significa che anche i missili sono rallentati, così come le fiamme delle torce, la pioggia, la gravità: tutto ciò che non è Kain;

===Prigionieri===
* Sono ridotte le possibilità che sia detta la frase &quot;Per favore aiutatemi, gentiluomo&quot;, può succedere solo quando Kain è abbastanza vicino;
===Nemici===
* I Lanciatori attaccano a 360 gradi (prima solo in 8 direzioni);
* L'Intelligenza Artificiale reagisce più velocemente, può dare la caccia a Kain e seguirlo;
* I nemici di combattimento ravvicinato sono in grado di attaccare meglio il giocatore;
* Gli abitanti delle città scappano quando vedono Kain;
===Interazione===
* Nuovi punti per osservare il mondo;
* Si possono rompere, prendere a calci e spingere oggetti nelle case;
* Tutti i puzzle sono ricalcolati casualmente. Ogni volta che riinizi il gioco, i puzzle che incontri (anche se non sono molti) saranno diversi dalla volta precedente;
* Alcuni dei precipizi delle mappe originali ora sono considerati punti di morte instantanea - appena Kain vi cade dentro, perde un Cuore delle Tenebre e viene teletrasportato in un punto di controllo;
* Ora le foreste sono semi-camminabili, permettendo di raggiungere nuovi posti e segreti;
* Ciclo atmosferico casuale (l'originale è stato corretto).
===Cambiamenti nel prologo===
* Kain non può attaccare nella taverna, questo limite è stato aggiunto per coerenza con il dialogo (Kain dice 'E così uscii').

{{initalian|Lista completa delle caratteristiche}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Lupo</title>
    <ns>0</ns>
    <id>629</id>
      <sha1>k8po0zvq2rfban0pia3zqj9ylvql9fs</sha1>
    <revision>
      <id>3525</id>
      <timestamp>2013-01-24T16:09:23Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;I lupi sono la componente più debole della fauna di Nosgoth, che attaccano i loro nemici mortendoli. In Blood Omen ci sono tre tipi di nemici che usano il modello del lupo.  ...&quot;</comment>
      <text xml:space="preserve" bytes="1278">I lupi sono la componente più debole della fauna di Nosgoth, che attaccano i loro nemici mortendoli. In Blood Omen ci sono tre tipi di nemici che usano il modello del lupo.

==Lupo==
{{BoEnemy|out|Bo enemy wolf.gif|Lupo}}
Il tipo base di lupo, di colore grigio scuro.

===Statistiche===
:Salute: 4
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_wolf]]

==Cane==
{{BoEnemy|out|Bo enemy dog.gif|Cane}}
Questa versione color marrone del lupo è più debole ed è possibile incontrarla vicino agli insediamenti umani.

===Statistiche===
:Salute: 2
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_dog]]

==Lupo del Dark Eden==
{{BoEnemy|eden |Bo enemy wolf.gif|Lupo del Dark Eden}}
Vicino al Dark Eden è possibile incontrare una variante più forte di lupo (nel gioco originale l'aspetto è esattamente lo stesso di un lupo normale).

===Statistiche===
:Salute: 8
:Danno: 6
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale

==Concept art==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

{{initalian|Lupo}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3526</id>
      <timestamp>2013-01-24T16:09:56Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1276">I lupi sono la componente più debole della fauna di Nosgoth, e attaccano i loro nemici mortendoli. In Blood Omen ci sono tre tipi di nemici che usano il modello del lupo.

==Lupo==
{{BoEnemy|out|Bo enemy wolf.gif|Lupo}}
Il tipo base di lupo, di colore grigio scuro.

===Statistiche===
:Salute: 4
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_wolf]]

==Cane==
{{BoEnemy|out|Bo enemy dog.gif|Cane}}
Questa versione color marrone del lupo è più debole ed è possibile incontrarla vicino agli insediamenti umani.

===Statistiche===
:Salute: 2
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_dog]]

==Lupo del Dark Eden==
{{BoEnemy|eden |Bo enemy wolf.gif|Lupo del Dark Eden}}
Vicino al Dark Eden è possibile incontrare una variante più forte di lupo (nel gioco originale l'aspetto è esattamente lo stesso di un lupo normale).

===Statistiche===
:Salute: 8
:Danno: 6
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale

==Concept art==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

{{initalian|Lupo}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3544</id>
      <timestamp>2013-01-24T18:19:11Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1279">I lupi sono la componente più debole della fauna di Nosgoth, e attaccano i loro nemici mortendoli. In Blood Omen ci sono tre tipi di nemici che usano il modello del lupo.

==Lupo==
{{NemiciBO|out|Bo enemy wolf.gif|Lupo}}
Il tipo base di lupo, di colore grigio scuro.

===Statistiche===
:Salute: 4
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_wolf]]

==Cane==
{{NemiciBO|out|Bo enemy dog.gif|Cane}}
Questa versione color marrone del lupo è più debole ed è possibile incontrarla vicino agli insediamenti umani.

===Statistiche===
:Salute: 2
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_dog]]

==Lupo del Dark Eden==
{{NemiciBO|eden |Bo enemy wolf.gif|Lupo del Dark Eden}}
Vicino al Dark Eden è possibile incontrare una variante più forte di lupo (nel gioco originale l'aspetto è esattamente lo stesso di un lupo normale).

===Statistiche===
:Salute: 8
:Danno: 6
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale

==Concept art==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

{{initalian|Lupo}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3549</id>
      <timestamp>2013-01-25T13:49:03Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1280">I lupi sono la componente più debole della fauna di Nosgoth, e attaccano i loro nemici mortendoli. In Blood Omen ci sono tre tipi di nemici che usano il modello del lupo.

==Lupo==
{{NemiciBO|out|Bo enemy wolf.gif|Lupo}}
Il tipo base di lupo, di colore grigio scuro.

===Statistiche===
:Salute: 4
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_wolf]]

==Cane==
{{NemiciBO|out|Bo enemy dog.gif|Cane}}
Questa versione color marrone del lupo è più debole, ed è possibile incontrarla vicino agli insediamenti umani.

===Statistiche===
:Salute: 2
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_dog]]

==Lupo del Dark Eden==
{{NemiciBO|eden |Bo enemy wolf.gif|Lupo del Dark Eden}}
Vicino al Dark Eden è possibile incontrare una variante più forte di lupo (nel gioco originale l'aspetto è esattamente lo stesso di un lupo normale).

===Statistiche===
:Salute: 8
:Danno: 6
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale

==Concept art==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

{{initalian|Lupo}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3550</id>
      <timestamp>2013-01-26T13:28:50Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1290">I lupi sono la componente più debole della fauna di Nosgoth, e attaccano i loro nemici mordendoli. In Blood Omen ci sono tre tipi di nemici che usano il modello del lupo.

==Lupo==
{{NemiciBO|out|Bo enemy wolf.gif|Lupo}}
Il tipo base di lupo, di colore grigio scuro.

===Statistiche===
:Salute: 4
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_wolf]]

==Cane==
{{NemiciBO|out|Bo enemy dog.gif|Cane}}
Questa versione color marrone del lupo è più debole, ed è possibile incontrarla vicino agli insediamenti umani.

===Statistiche===
:Salute: 2
:Danno: 3
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_dog]]

==Lupo del Dark Eden==
{{NemiciBO|eden |Bo enemy wolf.gif|Lupo del Dark Eden}}
Vicino al Dark Eden è possibile incontrare una variante più forte di lupo (nel gioco originale l'aspetto è esattamente lo stesso di un lupo normale).

===Statistiche===
:Salute: 8
:Danno: 6
:Sangue: rosso
:Velocità di movimento: alta
:Tipo di personaggio: animale

==Concept art==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

{{initalian|Lupo}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/MD3</title>
    <ns>0</ns>
    <id>638</id>
      <sha1>89f5tn62f8cryo7csmc0urnsrp2n4jz</sha1>
    <revision>
      <id>3562</id>
      <timestamp>2013-01-31T14:07:53Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}}  L'MD3 è un formato per modelli sviluppato da id Software. Viene usato dall'Engine di Quake 3 e in tutte le altre Engine successive e derivate, tra cui anche l...&quot;</comment>
      <text xml:space="preserve" bytes="1591">{{unfinished}}

L'MD3 è un formato per modelli sviluppato da id Software. Viene usato dall'Engine di Quake 3 e in tutte le altre Engine successive e derivate, tra cui anche la Darkplaces. 

Questo formato viene usato soprattutto per i modelli del giocatore e degli NPC e per le [[misc_gamemodel | geometrie non strutturali]], benché possa essere usato anche per [[misc_model| usi strutturali]].

In Blood Omnicice, l'MD3 è il formato generico usato per i modelli non animati.

==Caratteristiche==
* Animazione basata sui vertici
* Più superfici (mesh) per ogni modello
* Precisione dei vertici da numeri in virgola mobile (senza quasi traballamenti)
* Può reggere un numero davvero alto di triangoli.
* Supporta le tag (vettori senza volume), un tipo più leggero di armatura usato anche per legare insieme modelli diversi e punti particolari.

==Limiti==
* Massimo 65536 vertici
* Massimo 32768 triangoli
* Massimo 65536 frame
* Massimo 256 mesh
* Massimo 256 [[skin | skin]]
* Le normali dei vertici sono salvate come coppie di angoli in byte (assi laterale e verticale)
* Non supporta gli smoothing group (per simulare gli SG la mesh va alterata a parte)

==Chi lo può importare==
* Lo script &quot;importa mesh MD3&quot; di 3D Studio MAX

==Chi lo può esportare==
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[Darkplaces MD3 Exporter per 3D Studio MAX]]

==Tutorials==
* [[Tutorial: Modificare il percorso per le skin con MD3 Compiler | Modificare un materiale usando MD3 Compiler di NPherno]]



[[Category:InItalian/Formati_di_file]]
{{initalian|MD3}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3563</id>
      <timestamp>2013-01-31T14:08:30Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1592">{{unfinished}}

L'MD3 è un formato per modelli sviluppato da id Software. Viene usato dall'Engine di Quake 3 e in tutte le altre Engine successive e derivate, tra cui anche la Darkplaces. 

Questo formato viene usato soprattutto per i modelli del giocatore e degli NPC e per le [[misc_gamemodel | geometrie non strutturali]], benché possa essere usato anche per [[misc_model| usi strutturali]].

In Blood Omnicice, l'MD3 è il formato generico usato per i modelli non animati.

==Caratteristiche==
* Animazione basata sui vertici
* Più superfici (mesh) per ogni modello
* Precisione dei vertici da numeri in virgola mobile (senza quasi traballamenti)
* Può reggere un numero davvero alto di triangoli.
* Supporta le tag (vettori senza volume), un tipo più leggero di armatura usato anche per legare insieme modelli diversi e punti particolari.

==Limiti==
* Massimo 65536 vertici
* Massimo 32768 triangoli
* Massimo 65536 frame
* Massimo 256 mesh
* Massimo 256 [[skin | skin]]
* Le normali dei vertici sono salvate come coppie di angoli in byte (assi laterale e verticale)
* Non supporta gli smoothing group (per simulare gli SG la mesh va alterata a parte)

==Chi lo può importare==
* Lo script &quot;importa mesh MD3&quot; di 3D Studio MAX

==Chi lo può esportare==
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[Darkplaces MD3 Exporter per 3D Studio MAX]]

==Tutorials==
* [[Tutorial: Modificare il percorso per le skin con MD3 Compiler | Modificare un materiale usando MD3 Compiler di NPherno]]



[[Category:InItalian/Formati_dei_file]]
{{initalian|MD3}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3572</id>
      <timestamp>2013-01-31T14:54:08Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1608">{{unfinished}}

L'MD3 è un formato per modelli sviluppato da id Software. Viene usato dall'Engine di Quake 3 e in tutte le altre Engine successive e derivate, tra cui anche la Darkplaces. 

Questo formato viene usato soprattutto per i modelli del giocatore e degli NPC e per le [[misc_gamemodel | geometrie non strutturali]], benché possa essere usato anche per [[misc_model| usi strutturali]].

In Blood Omnicice, l'MD3 è il formato generico usato per i modelli non animati.

==Caratteristiche==
* Animazione basata sui vertici
* Più superfici (mesh) per ogni modello
* Precisione dei vertici da numeri in virgola mobile (senza quasi traballamenti)
* Può reggere un numero davvero alto di triangoli.
* Supporta le tag (vettori senza volume), un tipo più leggero di armatura usato anche per legare insieme modelli diversi e punti particolari.

==Limiti==
* Massimo 65536 vertici
* Massimo 32768 triangoli
* Massimo 65536 frame
* Massimo 256 mesh
* Massimo 256 [[skin | skin]]
* Le normali dei vertici sono salvate come coppie di angoli in byte (assi laterale e verticale)
* Non supporta gli smoothing group (per simulare gli SG la mesh va alterata a parte)

==Chi lo può importare==
* Lo script &quot;importa mesh MD3&quot; di 3D Studio MAX

==Chi lo può esportare==
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler]]
* [[Darkplaces MD3 Exporter per 3D Studio MAX]]

==Tutorial==
* [[Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler | Modificare un materiale usando MD3 Compiler di NPherno]]



[[Category:InItalian/Formati_dei_file]]
{{initalian|MD3}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/MD3 Compiler</title>
    <ns>0</ns>
    <id>601</id>
      <sha1>air0iff0vle8700wt4jrt24vl2gfang</sha1>
    <revision>
      <id>3385</id>
      <timestamp>2013-01-21T17:59:46Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{grammar checked|darth}} [[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]] MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a ...&quot;</comment>
      <text xml:space="preserve" bytes="1138">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si altera il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Altering a material using NPherno MD3 Compiler]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3386</id>
      <timestamp>2013-01-21T18:00:22Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Tutorial */</comment>
      <text xml:space="preserve" bytes="1146">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si altera il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Modificare un materiale usando MD3 Compiler di NPherno]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3387</id>
      <timestamp>2013-01-21T18:00:36Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Bug noti */</comment>
      <text xml:space="preserve" bytes="1148">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Compiler main window]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si modifica il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Modificare un materiale usando MD3 Compiler di NPherno]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3415</id>
      <timestamp>2013-01-22T14:24:16Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1163">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Finestra principale del compilatore]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si modifica il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Tutorials:Altering a material using NPherno MD3 Compiler|Modificare un materiale usando MD3 Compiler di NPherno]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3554</id>
      <timestamp>2013-01-26T20:32:25Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="1170">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Finestra principale del compilatore]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si modifica il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Tutorial: Modificare il percorso per le skin con MD3 Compiler | Modificare un materiale usando MD3 Compiler di NPherno]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3573</id>
      <timestamp>2013-01-31T14:54:25Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1187">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Finestra principale del compilatore]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si modifica il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler | Modificare un materiale usando MD3 Compiler di NPherno]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3574</id>
      <timestamp>2013-01-31T14:55:08Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1229">{{grammar checked|darth}}
[[File:Tutorial_md3_01.jpg|thumb|300px|Finestra principale del compilatore]]
MD3 Compiler di NPherno è un piccolo ma comodo tool per vedere un preview e mettere a posto i modelli [[Portal:InItalian/MD3|MD3]].

==Caratteristiche== 
* Supporto per file MD3, [[Portal:InItalian/ASE|ASE]] e 3DS
* Esportazione come MD3
* Ispezione della struttura del modello (superfici, materiali, shading, frame, tag)
* Modifica dei materiali assegnati ad una superficie
* Rimozione di frame o superficie selezionato
* Ricalcolo delle normali usando le seam della mappa UV o la smooth mode

==Bug noti==
{{bug|Quando si modifica il materiale o il nome di una superficie le modifiche non vengono salvate finché non è stata selezionata un'altra superficie. Per applicare le modifiche fare click sulla dropbox e scegliere una superficie.}}
{{bug|Le normali non vengono caricate dagli ASE e dai 3DS, bisogna ricrearle.}}

==Tutorial==
* [[Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler | Modificare un materiale usando MD3 Compiler di NPherno]]

==Download==
http://omnicide.legacy-of-kain.ru/files/tools/md3_compiler.zip

{{initalian|MD3 Compiler}}
[[Category:Tools]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Mostro d'ossa</title>
    <ns>0</ns>
    <id>633</id>
      <sha1>dt65230kmx6adze9o3qxamhce2qb5gt</sha1>
    <revision>
      <id>3532</id>
      <timestamp>2013-01-24T16:48:16Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden|bo_enemy_insectbeast.gif|Mostro d'ossa}} Mostro slanciato che avanza a quattro zampe armato di sottili e lunghe chele (o lame) al termine delle braccia. Il corp...&quot;</comment>
      <text xml:space="preserve" bytes="966">{{BoEnemy|eden|bo_enemy_insectbeast.gif|Mostro d'ossa}}
Mostro slanciato che avanza a quattro zampe armato di sottili e lunghe chele (o lame) al termine delle braccia. Il corpo è rivestito di una pelle rossastra con sottili strisce nere orizzontali, e due speroni ossei gli escono dalle spalle. L'animazione dell'attacco è molto simile a quella della [[Portal:InItalian/Bestia delle cavene|bestia delle caverne]], ma colpisce prima con un braccio e subito dopo con l'altro, causando potenzialmente danno doppio. Vive all'aperto e nelle caverne vicino al Dark Eden, nonché nella Cattedrale di Avernus.

===Statistiche===
:Salute: 20
:Danno: 10 (con ogni braccio)
:Sangue: verde
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_insectbeast]]

==Concept art==
&lt;gallery&gt;
File:Enigma insectbeast sketch.jpg
File:Lakdav insectbeast.jpg
&lt;/gallery&gt;

{{initalian|Mostro d'ossa}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3533</id>
      <timestamp>2013-01-24T16:48:58Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="967">{{BoEnemy|eden|bo_enemy_insectbeast.gif|Mostro d'ossa}}
Mostro slanciato che avanza a quattro zampe armato di sottili e lunghe chele (o lame) al termine delle braccia. Il corpo è rivestito di una pelle rossastra con sottili strisce nere orizzontali, e due speroni ossei gli escono dalle spalle. L'animazione dell'attacco è molto simile a quella della [[Portal:InItalian/Bestia delle caverne|bestia delle caverne]], ma colpisce prima con un braccio e subito dopo con l'altro, causando potenzialmente danno doppio. Vive all'aperto e nelle caverne vicino al Dark Eden, nonché nella Cattedrale di Avernus.

===Statistiche===
:Salute: 20
:Danno: 10 (con ogni braccio)
:Sangue: verde
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_insectbeast]]

==Concept art==
&lt;gallery&gt;
File:Enigma insectbeast sketch.jpg
File:Lakdav insectbeast.jpg
&lt;/gallery&gt;

{{initalian|Mostro d'ossa}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3545</id>
      <timestamp>2013-01-24T18:20:38Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="920">{{NemiciBO|eden|bo_enemy_insectbeast.gif|Mostro d'ossa}}
Mostro slanciato che avanza a quattro zampe armato di sottili e lunghe chele (o lame) al termine delle braccia. Il corpo è rivestito di una pelle rossastra con sottili strisce nere orizzontali, e due speroni ossei gli escono dalle spalle. L'animazione dell'attacco è molto simile a quella della [[Portal:InItalian/Bestia delle caverne|bestia delle caverne]], ma colpisce prima con un braccio e subito dopo con l'altro, causando potenzialmente danno doppio. Vive all'aperto e nelle caverne vicino al Dark Eden, nonché nella Cattedrale di Avernus.

===Statistiche===
:Salute: 20
:Danno: 10 (con ogni braccio)
:Sangue: verde
:Velocità di movimento: alta
:Tipo di personaggio: animale
:Entity: [[enemy_insectbeast]]

==Concept art==
&lt;gallery&gt;
File:Enigma insectbeast sketch.jpg
File:Lakdav insectbeast.jpg
&lt;/gallery&gt;

{{initalian|Mostro d'ossa}}
__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Muso dentato</title>
    <ns>0</ns>
    <id>634</id>
      <sha1>iuc5lqze3hf9xe2i3tq6e3qsy9wp25e</sha1>
    <revision>
      <id>3534</id>
      <timestamp>2013-01-24T17:04:10Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden|bo_enemy_sawtooth.gif|Muso dentato}} Il muso dentato è uno dei mutanti del Dark Eden; non è facile dire quali creature siano state usate per crearlo. Il massi...&quot;</comment>
      <text xml:space="preserve" bytes="1193">{{BoEnemy|eden|bo_enemy_sawtooth.gif|Muso dentato}}
Il muso dentato è uno dei mutanti del Dark Eden; non è facile dire quali creature siano state usate per crearlo. Il massicio corpo è quasi integralmente coperto da un materiale grigio protettivo, e nei punti esposti la pelle è rivestita di una peluria marrone. Ha gambe corte terminanti in quelli che sembrano zoccoli di cinghiale, decisamente spostate all'indietro rispetto al baricentro dell'animale. L'enorme testa, che occupa metà della lunghezza complessiva, è priva di occhi e si appiattisce verso la punta del muso, che è dotato di una fitta striscia di tenti affilati che ricordano la lama di una sega - come se la bocca dell'animale fosse stata rivoltata, lasciando i denti all'esterno. La robusta protezione lo rende difficile da uccidere; l'attacco da corpo a corpo, d'altra parte, è molto lento e facilmente evitabile.

==Statistiche==
:Salute: 40
:Danno: 10
:Sangue: rosso
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_sawtooth]]

==Concept art==
&lt;gallery&gt;
File:Amddred sawtooth.png
&lt;/gallery&gt;

{{initalian|Muso dentato}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3546</id>
      <timestamp>2013-01-24T18:20:51Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1146">{{NemiciBO|eden|bo_enemy_sawtooth.gif|Muso dentato}}
Il muso dentato è uno dei mutanti del Dark Eden; non è facile dire quali creature siano state usate per crearlo. Il massicio corpo è quasi integralmente coperto da un materiale grigio protettivo, e nei punti esposti la pelle è rivestita di una peluria marrone. Ha gambe corte terminanti in quelli che sembrano zoccoli di cinghiale, decisamente spostate all'indietro rispetto al baricentro dell'animale. L'enorme testa, che occupa metà della lunghezza complessiva, è priva di occhi e si appiattisce verso la punta del muso, che è dotato di una fitta striscia di tenti affilati che ricordano la lama di una sega - come se la bocca dell'animale fosse stata rivoltata, lasciando i denti all'esterno. La robusta protezione lo rende difficile da uccidere; l'attacco da corpo a corpo, d'altra parte, è molto lento e facilmente evitabile.

==Statistiche==
:Salute: 40
:Danno: 10
:Sangue: rosso
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_sawtooth]]

==Concept art==
&lt;gallery&gt;
File:Amddred sawtooth.png
&lt;/gallery&gt;

{{initalian|Muso dentato}}
__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/NSX</title>
    <ns>0</ns>
    <id>640</id>
      <sha1>tbe4gmurjmy2jvw5qpko62qptwvj90l</sha1>
    <revision>
      <id>3565</id>
      <timestamp>2013-01-31T14:25:01Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;File di testo di tipo INI con lo scopo di contenere la configurazione sotto forma di gruppo-&gt;chiave-&gt;valore.  Più di un valore può essere associato alla chiave (può contene...&quot;</comment>
      <text xml:space="preserve" bytes="505">File di testo di tipo INI con lo scopo di contenere la configurazione sotto forma di gruppo-&gt;chiave-&gt;valore.

Più di un valore può essere associato alla chiave (può contenere una tabella).

Esempio di file .NSX:
 [gruppo1]
 chiave1=valore1 # commento
 chiave2=valore2
 [gruppo2]chiave=parametro1&amp;|parametro2
 chiave1=x|y
 chiave2=qualche|variabile

I file .NSX sono parte del [[NetherMenu | NetherMenu framework ]]


[[Category:InItalian/Formati_dei_file]]
{{initalian|NSX}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/NSX (QFont)</title>
    <ns>0</ns>
    <id>645</id>
      <sha1>29yux0lxx4kp1hdiz6i24ybjks3ibgq</sha1>
    <revision>
      <id>3575</id>
      <timestamp>2013-01-31T18:09:08Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;[[Portal:InItalian/NSX|Script NSX]] che memorizza i parametri del modulo per il rendering del font nel [[NetherMenu]].  Esempio di file QFONT:   ''[qfont]''  type=FT  face=def...&quot;</comment>
      <text xml:space="preserve" bytes="4154">[[Portal:InItalian/NSX|Script NSX]] che memorizza i parametri del modulo per il rendering del font nel [[NetherMenu]].

Esempio di file QFONT:

 ''[qfont]''
 type=FT
 face=default
 brightness=0.8
 width=1.2
 
 ''[default]''
 file=./big.ttf
 sizes=38
 glyph=abcdefghijklmnopqrttuvwxyz0123456789
 r_shadow=0.8
 r_shadowblur=1
 r_shadowofs=0 0.5 0.5

==Struttura dati==

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Chiavi
! width=83% | Descrizione
|-
| '''[qfont]'''
| Deve essere il primo gruppo di file.
|-
|'''type'''=''x''
|Dipo di renderer del font, ognuno ha propri vantaggi e svantaggi:

Valori possibili:
* FT - vettore dei font della Darkplaces che usano una libreria FreeType
* ASCII - i conchar di Quake ASCII (256 caratteri in una tabella 16*16)
* GLYPH - renderer di glyph di QuakeC (ogni carattere è un'immagine distinta)
|-
|'''face'''=''string''
|Aspetto del font. Per i renderer di font FreeTyper e glyph questo valore è il nome del gruppo. Per l'ASCII è un percorso per la texture del conchar.
|-
|'''brightness'''=''valore''
|Valore in virgola mobile della scala di luminosità. 1 è niente, 0.1 è il 10% ecc.
|-
|'''scale'''=''x'' ''y''
|Due valori in virgola mobile che definiscono la scala orizzontale e verticale dei caratteri del font.
|-
|'''width'''=''x''
|componente X della scala.
|-
|'''height'''=''y''
|componente Y della scala.
|-
|'''respath'''=''percorso''
|Percorso per la risorsa del font. Può essere relativo (se inizia con ./) o assoluto (dalla cartella di gioco). Di default è la sottocartella con lo stesso nome del file del font (dunque se il file del font si chiama gfx/myfont.qfont la cartella della risorsa di default sarà ''gfx/myfont/'').
|}

{{hidden begin | Gruppo del font face FreeType }}

Gli attributi del font face per un renderer di font FreeType.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Chiavi
! width=83% | Descrizione
|-
|'''file'''=''percorso''
|Percorso verso il file .OTF/.TTF del font. Può essere relativo al respath (se inizia con ./) o assoluto (dalla root della cartella di gioco).
|-
|'''slot'''=''nomeslot''
|slot per il font della Engine. Usato per sostituire le fontmap già inizializzate.

La Darkplaces Engine ha questi slot fissi: default, console, sbar, notify, chat, centerprint, infobar,  menu, user0, user1, user2, user3, user4, user5, user6, user7.
|-
|'''glyphs'''=''string''
|slot per il font della Engine. Usato per sostituire le fontmap già inizializzate.

L'Engine farà il render delle pagine del font che contengono i caratteri di questa string (gli altri potranno essere ri-renderizzati su richiesta).
|-
|'''r_antialias'''=''0/1''
|Decide l'antialiasing per il renderer di pagine di font.
|-
|'''r_hinting'''=''0/1/2/3''
|Decide l'hinting per il renderer di pagine di font. 0 - nessun hinting, 1 - debole autohinting, 2 - autohinting completo, 3 - hinting completo.
|-
|'''r_shadow'''=''marcatezza''
|Marcatezza dell'outline shadow (può essere più di 1).
|-
|'''r_shadowblur'''=''marcatezza''
|Blur dell'outline shadow.
|-
|'''r_shadowofs'''=''x y z''
|Offset dell'outline shadow. X e Y vengono applicate durante il rendering. Z è applicato durante il blur.
|-
|'''r_charcushion'''=''x''
|Offset verticale dei caratteri in percentuale (1 = 100%, 0.1 = 10% ecc.).
|-
|'''r_charscale'''=''x''
|Scala uniforme dei caratteri.
|}
{{hidden end}}

{{hidden begin | Gruppo del font face glyph }}

Attributi del font face per i renderer di font glyph.

{| border=&quot;1&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width:100%&quot;
! width=6% | Chiavi
! width=83% | Descrizione
|-
|'''respath'''=''percorso''
|Percorso assoluto che sovrascrive il percorso di default delle risorse del font.
|-
|'''glyph'''=''variabile''
|Il valore è una di queste string: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Il parametro kern è opzionale. Una sola immagine può avere più codici ASCII.
|}
{{hidden end}}



[[Category:InItalian/Formati_dei_file]]
{{initalian|NSX (QFont)}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/NSX (file delle righe di traduzione)</title>
    <ns>0</ns>
    <id>646</id>
      <sha1>glu8l5zu2fhr4ejmkllwht3uqh56irc</sha1>
    <revision>
      <id>3576</id>
      <timestamp>2013-01-31T18:22:55Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;[[NSX | File NSX]] che contiene le traduzioni delle righe di testo sotto forma di: ''string_id''=''riga_tradotta''.  Questi file vengono usati solo nei [[Portal:InItalian/Pack...&quot;</comment>
      <text xml:space="preserve" bytes="949">[[NSX | File NSX]] che contiene le traduzioni delle righe di testo sotto forma di: ''string_id''=''riga_tradotta''.

Questi file vengono usati solo nei [[Portal:InItalian/Pack_di_traduzione | pack di traduzione]].

{{consiglio|I gruppi vengono usati come prefissi per gli ID delle righe di testo in modo da rendere il codice più corto.}}

Esempio:

 [''menu_option'']
 res=Risoluzione
 windowed=A finestra
 bpp=Bit per pixel

crea 3 righe di testo:

 menu_option_res=Risoluzione
 menu_option_windowed=A finestra
 menu_option_bpp=Bit per pixel

Esempio di contenuti di un file di righe di testo:

 [''menu_btn'']
 yes         =&quot;SÌ&quot;
 no          =&quot;NO&quot;
 back        =&quot;INDIETRO&quot;
 newgame     =&quot;NUOVA PARTITA&quot;
 startgame   =&quot;COMINCIA PARTITA&quot;
 options     =&quot;OPZIONI&quot;
 loadgame    =&quot;CARICA PARTITA&quot;
 savegame    =&quot;SALVA PARTITA&quot;
 
 
 
[[Category:InItalian/Formati_dei_file]]
{{initalian|NSX (file delle righe di traduzione)}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3578</id>
      <timestamp>2013-01-31T18:35:47Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="966">[[Portal:InItalian/NSX | File NSX]] che contiene le traduzioni delle righe di testo sotto forma di: ''string_id''=''riga_tradotta''.

Questi file vengono usati solo nei [[Portal:InItalian/Pack_di_traduzione | pack di traduzione]].

{{consiglio|I gruppi vengono usati come prefissi per gli ID delle righe di testo in modo da rendere il codice più corto.}}

Esempio:

 [''menu_option'']
 res=Risoluzione
 windowed=A finestra
 bpp=Bit per pixel

crea 3 righe di testo:

 menu_option_res=Risoluzione
 menu_option_windowed=A finestra
 menu_option_bpp=Bit per pixel

Esempio di contenuti di un file di righe di testo:

 [''menu_btn'']
 yes         =&quot;SÌ&quot;
 no          =&quot;NO&quot;
 back        =&quot;INDIETRO&quot;
 newgame     =&quot;NUOVA PARTITA&quot;
 startgame   =&quot;COMINCIA PARTITA&quot;
 options     =&quot;OPZIONI&quot;
 loadgame    =&quot;CARICA PARTITA&quot;
 savegame    =&quot;SALVA PARTITA&quot;
 
 
 
[[Category:InItalian/Formati_dei_file]]
{{initalian|NSX (file delle righe di traduzione)}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Obiettivi e caratteristiche</title>
    <ns>0</ns>
    <id>595</id>
      <sha1>pz58p3zykspm6pto6ltfccyspgkq81n</sha1>
    <revision>
      <id>3353</id>
      <timestamp>2013-01-15T15:24:06Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}} Blood Omnicide è un progetto per ricreare Blood Omen: Legacy of Kain in 3D. Il progetto ha tre scopi principali:  '''Primo scopo''': Conservare l'atmosfera del...&quot;</comment>
      <text xml:space="preserve" bytes="2738">{{unfinished}}
Blood Omnicide è un progetto per ricreare Blood Omen: Legacy of Kain in 3D. Il progetto ha tre scopi principali:

'''Primo scopo''': Conservare l'atmosfera del gioco originale e offrire quasi lo stesso gameplay ed equilibrio. Questo, naturalmente, non nega miglioramenti e innovazioni, legati alla natura stessa del remake, ma senza apportare modifiche radicali per non violare l'esperienza di gioco.

'''Secondo scopo''': Il pacchetto di sviluppo dell'applicazione (SDK) è aperto per modifiche e aggiunte, così che Omnicide possa essere usato come base per pacchetti di espansione e mod create nel mondo di Blood Omen.

'''Terzo scopo''': Blood Omnicide è una modifica, consiste in una patch che porta il gioco originale in una nuova renderizzazione. Blood Omnicide richiede la versione originale per PC o PlayStation di Blood Omen per essere giocato.

== Gli obiettivi ==

I tre scopi principali compongono gli obiettivi del progetto:

* Ricostruire Blood Omen in 3D usando le risorse originali del gioco
* Svelare tutte le risorse originali e i formati perché siano usati dalla comunità
* Produrre un nuovo codice open-source adatto per creare nuovi livelli ed essere modificato
* Offrire quasi la stessa atmosfera di gioco e di colori presente nell'originale
* Aggiungere contenuti ad alta definizione in 3D
* Correggere i bug causati dalle limitazioni della vecchia tecnologia ed evolvere le caratteristiche originali come sono state fatte dagli sviluppatori di Blood Omen
* Aggiungere nuove caratteristiche opzionali

== Caratteristiche principali ==

=== Caratteristiche del gameplay ===
* Intelligenza Artificiale migliorata
* Dinamiche di gioco migliorate (combattimenti ed azioni)
* Maggiore interattività (motore fisico Open Dynamics Engine)
* Statistiche di gioco e risultati
* Linguaggio di scripting QuakeC

=== Creazione di livelli ===
* Tutti i livelli sono creati da zero
* Stile dei livelli &quot;dall'alto&quot;
* La maggior parte degli eventi sulle mappe sono scriptati, non cablati nel codice sorgente (così possono essere usati in mappe fatte dagli utenti)
* Gli oggetti segreti sono stati modificati (alcuni per essere trovati richiedono modi diversi dall'originale, altri sono stati cambiati per un'esperienza migliore di gioco)

=== Grafica ===
* Texture ad alta risoluzione (fino a 8 volte più dell'originale), nuovi effetti speciali
* Effetti grafici originali (sangue, tempo atmosferico, incantesimi) interamente restaurati e migliorati
* Nuova grafica 2D per il menù principale e l'inventario

=== Motore ===
* Supporto a più lingue (tramite pacchetti di localizzazione)
* Sottotitoli per dialoghi e video
* Livelli in formato Quake 3 BSP


{{initalian|Obiettivi e caratteristiche}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>3553</id>
      <timestamp>2013-01-26T13:38:54Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="2740">{{unfinished}}
Blood Omnicide è un progetto per ricreare Blood Omen: Legacy of Kain in 3D. Il progetto ha tre scopi principali:

'''Primo scopo''': Conservare l'atmosfera del gioco originale e offrire quasi lo stesso gameplay e bilanciamento. Questo, naturalmente, non nega miglioramenti e innovazioni, legati alla natura stessa del remake, ma senza apportare modifiche radicali per non violare l'esperienza di gioco.

'''Secondo scopo''': Il pacchetto di sviluppo dell'applicazione (SDK) è aperto per modifiche e aggiunte, così che Omnicide possa essere usato come base per pacchetti di espansione e mod create nel mondo di Blood Omen.

'''Terzo scopo''': Blood Omnicide è una modifica, consiste in una patch che porta il gioco originale in una nuova renderizzazione. Blood Omnicide richiede la versione originale per PC o PlayStation di Blood Omen per essere giocato.

== Gli obiettivi ==

I tre scopi principali compongono gli obiettivi del progetto:

* Ricostruire Blood Omen in 3D usando le risorse originali del gioco
* Svelare tutte le risorse originali e i formati perché siano usati dalla comunità
* Produrre un nuovo codice open-source adatto per creare nuovi livelli ed essere modificato
* Offrire quasi la stessa atmosfera di gioco e di colori presente nell'originale
* Aggiungere contenuti ad alta definizione in 3D
* Correggere i bug causati dalle limitazioni della vecchia tecnologia ed evolvere le caratteristiche originali come sono state fatte dagli sviluppatori di Blood Omen
* Aggiungere nuove caratteristiche opzionali

== Caratteristiche principali ==

=== Caratteristiche del gameplay ===
* Intelligenza Artificiale migliorata
* Dinamiche di gioco migliorate (combattimenti ed azioni)
* Maggiore interattività (motore fisico Open Dynamics Engine)
* Statistiche di gioco e risultati
* Linguaggio di scripting QuakeC

=== Creazione di livelli ===
* Tutti i livelli sono creati da zero
* Stile dei livelli &quot;dall'alto&quot;
* La maggior parte degli eventi sulle mappe sono scriptati, non cablati nel codice sorgente (così possono essere usati in mappe fatte dagli utenti)
* Gli oggetti segreti sono stati modificati (alcuni per essere trovati richiedono modi diversi dall'originale, altri sono stati cambiati per un'esperienza migliore di gioco)

=== Grafica ===
* Texture ad alta risoluzione (fino a 8 volte più dell'originale), nuovi effetti speciali
* Effetti grafici originali (sangue, tempo atmosferico, incantesimi) interamente restaurati e migliorati
* Nuova grafica 2D per il menù principale e l'inventario

=== Motore ===
* Supporto a più lingue (tramite pacchetti di localizzazione)
* Sottotitoli per dialoghi e video
* Livelli in formato Quake 3 BSP


{{initalian|Obiettivi e caratteristiche}}

__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/PAK</title>
    <ns>0</ns>
    <id>641</id>
      <sha1>406ogbuf7vd2t917z9obxt4aed41pme</sha1>
    <revision>
      <id>3566</id>
      <timestamp>2013-01-31T14:37:10Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;Formato per gli archivi di gioco usato in Quake. Dato che esistono i [[PK3]], i PAK sono obsoleti.  [[Category:InItalian/Formati_dei_file]] {{initalian|PAK}} __NOEDITSECTION__...&quot;</comment>
      <text xml:space="preserve" bytes="185">Formato per gli archivi di gioco usato in Quake. Dato che esistono i [[PK3]], i PAK sono obsoleti.

[[Category:InItalian/Formati_dei_file]]
{{initalian|PAK}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3569</id>
      <timestamp>2013-01-31T14:51:50Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="206">Formato per gli archivi di gioco usato in Quake. Dato che esistono i [[Portal:InItalian/PK3|PK3]], i PAK sono obsoleti.

[[Category:InItalian/Formati_dei_file]]
{{initalian|PAK}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3621</id>
      <timestamp>2013-03-23T18:29:19Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="255">Formato per gli archivi di gioco usato in Quake. Dato che esistono i [[Portal:InItalian/PK3|PK3]], i PAK sono obsoleti.

[[Category:InItalian/Formati_dei_file]]
[[Category:InItalian/Motore_grafico_DarkPlaces]]
{{initalian|PAK}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/PK3</title>
    <ns>0</ns>
    <id>642</id>
      <sha1>k8i25urhqabmtcs54594ksgv99g5vbf</sha1>
    <revision>
      <id>3567</id>
      <timestamp>2013-01-31T14:39:43Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;File ZIP rinominati usati nei giochi lanciati con id Tech 3 e dalla Darkplaces Engine.  Possono essere creati, visualizzati ed estratti usando strumenti per archivi ZIP, come ...&quot;</comment>
      <text xml:space="preserve" bytes="278">File ZIP rinominati usati nei giochi lanciati con id Tech 3 e dalla Darkplaces Engine.

Possono essere creati, visualizzati ed estratti usando strumenti per archivi ZIP, come 7-Zip e WinRar.


[[Category:InItalian/Formati_dei_file]]
{{initalian|PK3}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3620</id>
      <timestamp>2013-03-23T18:29:05Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="327">File ZIP rinominati usati nei giochi lanciati con id Tech 3 e dalla Darkplaces Engine.

Possono essere creati, visualizzati ed estratti usando strumenti per archivi ZIP, come 7-Zip e WinRar.


[[Category:InItalian/Formati_dei_file]]
[[Category:InItalian/Motore_grafico_DarkPlaces]]
{{initalian|PK3}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Pack di traduzione</title>
    <ns>0</ns>
    <id>598</id>
      <sha1>bbcg78keu85gv3mc78xmcv29ypnroic</sha1>
    <revision>
      <id>3367</id>
      <timestamp>2013-01-20T13:51:29Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;== Introduzione ==  Blood Omnicide supporta pack di traduzione sotto forma di [[PK3 | file PK3]] separati.   Questo articolo spiegherà come realizzarli, per permettere la cre...&quot;</comment>
      <text xml:space="preserve" bytes="5093">== Introduzione ==

Blood Omnicide supporta pack di traduzione sotto forma di [[PK3 | file PK3]] separati. 

Questo articolo spiegherà come realizzarli, per permettere la creazione autonoma di pack di localizzazione.

Alcune informazioni sui pack di traduzione:

* È possibile tradurre testi, texture, suoni, tutto

* La lingua può essere cambiata senza uscire dal gioco

* Andrebbero creati nuovi pack di traduzione per permettere un supporto per più lingue

== Nomi ==

La nomenclatura standard per i file delle localizzazioni è '''L-localename0.PK3''', dove &quot;localename&quot; serve a identificare la lingua.

Esempio: un pack di localizzazione spagnola dovrebbe chiamarsi '''L-espanol0.PK3'''.

Si mette un numero alla fine per spezzare una localizzazione, in modo da separare in più file PK3 (o di creare dei pack di update in un secondo momento); la engine li leggerà in ordine: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3'''...

== Codifica per il testo ==

Tutti i file di testo devono usare la codifica Unicode (UTF-8) senza BOM (Byte-Order-Mark). 

{{important|Codifiche nazionali (quelle usate dal Blocco note di Windows) non sono supportate. Tutti i file devono essere in Unicode.}}

{{bug|È anche importante che i file in UTF-8 siano senza BOM; trascurare questa regola può causare crash nella engine.}}

Strumenti per modificare file in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contenuti dei pack di traduzione ==

* '''kain''' - cartella base
** '''locales'''
*** ''localename.nsx'' - testo di descrizione della localizzazione
*** ''localename.tga'' - immagine relativa alla localizzazione nel menu delle lingue
*** '''locale/''' - cartella generale della localizzazione
**** '''localename/''' - cartella base della localizzazione
**** '''fonts/''' - file di definizione dei font e del loro aspetto (vedere [[NSX_(QFont) | file QFONT]])
**** '''maps/''' - righe di traduzione testi della mappa (vedere [[NSX | file NSX]])
**** '''video/'''- traduzione sottotitoli per le cinematiche (vedere [[DPSUBS | file DPSUBS]])
**** ''credits.nsx'' - [[NSX (Translation string files) | righe di traduzione]] per i titoli di coda
**** ''gameover.nsx'' - righe di traduzione per la schermata di game over
**** ''gamestats.nsx'' - righe di traduzione per le statistiche della partita
**** ''menu.nsx'' - righe di traduzione per i menu
**** ''prestige.nsx'' - righe di traduzione per la classificazione del giocatore
**** ''speech.nsx'' - righe di traduzione per i dialoghi
**** ''ui.ns2'' - inizializzazione interfaccia utente (vedere [[NS2|file NS2]])

== Come fare una traduzione ==

# Scaricare un pack campione;
# Decomprimerlo in modo da avere accesso ai file
# Rinominarlo nella propria lingua
# Trovare font .TTF/.OTF che vanno bene per la lingua e aggiungerli al pack (sostituendo i font originali)
# Tradurre tutti file con delle righe di testo (.nsx)
# Tradurre i sottotitoli alle cinematiche (.dpsubs)
# Tradurre l'ui.ns2
# Creare una mappa con le didascalie tradotte
# Creare un'immagine da mettere nel menu di selezione lingua
# Modificare il testo di descrizione della localizzazione (con autore e versione)
# (Opzionale) Aggiungere i file alternativi di dialogo
# (Opzionale) Aggiungere i file dell'audio alternativo delle cinematiche
# Creare un file [[PK3]];

== Tag interattive per il parlato ==
Ci sono due modalità possibili per i sottotitoli al parlato - classica e interattiva. La modalità classica mostra i sottotitoli nella parte bassa dello schermo, quella interattiva sopra ai personaggi che stanno parlando.

La modalità interattiva è leggermente diversa nell'aspetto, quindi ci sono tag speciali per permettere che il discorso venga mostrato nella modalità migliore:

* {testo} - verrà mostrato solo nella modalità classica
* [testo] - verrà mostrato solo nella modalità interattiva
* &lt;numero&gt; - marker temporale per le porzioni dei sottotitoli interattivi. &quot;una&lt;3&gt;frase&quot; separerà i sottotitoli in due, con la seconda parte che subentrerà 3 secondi dopo l'inizio del parlato.

== Testare il parlato nel gioco ==
{{cmd|cl_cmd playspeech &lt;tipo&gt; &lt;personaggio&gt; &lt;numero&gt;| questo comando della [[console]] aiuta a testare tutti i dialoghi della mappa corrente.}}

I tipi sono:
*speech - dialogo standard
*whisp - voci &quot;nella testa di Kain&quot; (ad esempio i commenti di Mortanius), sempre mostrati nella modalità classica

== Pack di localizzazione campione ==
Questo è l'elenco dei pack di localizzazione di riferimento che possono essere usati come base:

''' Blood Omnicide v0.1  '''

:Inglese: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Usano il vecchio layout di traduzione)
:Inglese: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russo: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Spagnolo: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{initalian|Traduzione}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3379</id>
      <timestamp>2013-01-21T17:19:02Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="5101">== Introduzione ==

Blood Omnicide supporta pack di traduzione sotto forma di [[PK3 | file PK3]] separati. 

Questo articolo spiegherà come realizzarli, per permettere la creazione autonoma di pack di localizzazione.

Alcune informazioni sui pack di traduzione:

* È possibile tradurre testi, texture, suoni, tutto

* La lingua può essere cambiata senza uscire dal gioco

* Andrebbero creati nuovi pack di traduzione per permettere un supporto per più lingue

== Nomi ==

La nomenclatura standard per i file delle localizzazioni è '''L-localename0.PK3''', dove &quot;localename&quot; serve a identificare la lingua.

Esempio: un pack di localizzazione spagnola dovrebbe chiamarsi '''L-espanol0.PK3'''.

Si mette un numero alla fine per spezzare una localizzazione, in modo da separare in più file PK3 (o di creare dei pack di update in un secondo momento); la engine li leggerà in ordine: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3'''...

== Codifica per il testo ==

Tutti i file di testo devono usare la codifica Unicode (UTF-8) senza BOM (Byte-Order-Mark). 

{{important|Codifiche nazionali (quelle usate dal Blocco note di Windows) non sono supportate. Tutti i file devono essere in Unicode.}}

{{bug|È anche importante che i file in UTF-8 siano senza BOM; trascurare questa regola può causare crash nella engine.}}

Strumenti per modificare file in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contenuti dei pack di traduzione ==

* '''kain''' - cartella base
** '''locales'''
*** ''localename.nsx'' - testo di descrizione della localizzazione
*** ''localename.tga'' - immagine relativa alla localizzazione nel menu delle lingue
*** '''locale/''' - cartella generale della localizzazione
**** '''localename/''' - cartella base della localizzazione
**** '''fonts/''' - file di definizione dei font e del loro aspetto (vedere [[NSX_(QFont) | file QFONT]])
**** '''maps/''' - righe di traduzione testi della mappa (vedere [[NSX | file NSX]])
**** '''video/'''- traduzione sottotitoli per le cinematiche (vedere [[DPSUBS | file DPSUBS]])
**** ''credits.nsx'' - [[NSX (Translation string files) | righe di traduzione]] per i titoli di coda
**** ''gameover.nsx'' - righe di traduzione per la schermata di game over
**** ''gamestats.nsx'' - righe di traduzione per le statistiche della partita
**** ''menu.nsx'' - righe di traduzione per i menu
**** ''prestige.nsx'' - righe di traduzione per la classificazione del giocatore
**** ''speech.nsx'' - righe di traduzione per i dialoghi
**** ''ui.ns2'' - inizializzazione interfaccia utente (vedere [[NS2|file NS2]])

== Come fare una traduzione ==

# Scaricare un pack campione;
# Decomprimerlo in modo da avere accesso ai file
# Rinominarlo nella propria lingua
# Trovare font .TTF/.OTF che vanno bene per la lingua e aggiungerli al pack (sostituendo i font originali)
# Tradurre tutti file con delle righe di testo (.nsx)
# Tradurre i sottotitoli alle cinematiche (.dpsubs)
# Tradurre l'ui.ns2
# Creare una mappa con le didascalie tradotte
# Creare un'immagine da mettere nel menu di selezione lingua
# Modificare il testo di descrizione della localizzazione (con autore e versione)
# (Opzionale) Aggiungere i file alternativi di dialogo
# (Opzionale) Aggiungere i file dell'audio alternativo delle cinematiche
# Creare un file [[PK3]];

== Tag interattive per il parlato ==
Ci sono due modalità possibili per i sottotitoli al parlato - classica e interattiva. La modalità classica mostra i sottotitoli nella parte bassa dello schermo, quella interattiva sopra ai personaggi che stanno parlando.

La modalità interattiva è leggermente diversa nell'aspetto, quindi ci sono tag speciali per permettere che il discorso venga mostrato nella modalità migliore:

* {testo} - verrà mostrato solo nella modalità classica
* [testo] - verrà mostrato solo nella modalità interattiva
* &lt;numero&gt; - marker temporale per le porzioni dei sottotitoli interattivi. &quot;una&lt;3&gt;frase&quot; separerà i sottotitoli in due, con la seconda parte che subentrerà 3 secondi dopo l'inizio del parlato.

== Testare il parlato nel gioco ==
{{cmd|cl_cmd playspeech &lt;tipo&gt; &lt;personaggio&gt; &lt;numero&gt;| questo comando della [[console]] aiuta a testare tutti i dialoghi della mappa corrente.}}

I tipi sono:
*speech - dialogo standard
*whisp - voci &quot;nella testa di Kain&quot; (ad esempio i commenti di Mortanius), sempre mostrati nella modalità classica

== Pack di localizzazione campione ==
Questo è l'elenco dei pack di localizzazione di riferimento che possono essere usati come base:

''' Blood Omnicide v0.1  '''

:Inglese: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Usano il vecchio layout di traduzione)
:Inglese: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russo: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Spagnolo: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{initalian|Pack di traduzione}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3462</id>
      <timestamp>2013-01-22T19:04:43Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* Codifica per il testo */</comment>
      <text xml:space="preserve" bytes="5102">== Introduzione ==

Blood Omnicide supporta pack di traduzione sotto forma di [[PK3 | file PK3]] separati. 

Questo articolo spiegherà come realizzarli, per permettere la creazione autonoma di pack di localizzazione.

Alcune informazioni sui pack di traduzione:

* È possibile tradurre testi, texture, suoni, tutto

* La lingua può essere cambiata senza uscire dal gioco

* Andrebbero creati nuovi pack di traduzione per permettere un supporto per più lingue

== Nomi ==

La nomenclatura standard per i file delle localizzazioni è '''L-localename0.PK3''', dove &quot;localename&quot; serve a identificare la lingua.

Esempio: un pack di localizzazione spagnola dovrebbe chiamarsi '''L-espanol0.PK3'''.

Si mette un numero alla fine per spezzare una localizzazione, in modo da separare in più file PK3 (o di creare dei pack di update in un secondo momento); la engine li leggerà in ordine: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3'''...

== Codifica per il testo ==

Tutti i file di testo devono usare la codifica Unicode (UTF-8) senza BOM (Byte-Order-Mark). 

{{importante|Codifiche nazionali (quelle usate dal Blocco note di Windows) non sono supportate. Tutti i file devono essere in Unicode.}}

{{bug|È anche importante che i file in UTF-8 siano senza BOM; trascurare questa regola può causare crash nella engine.}}

Strumenti per modificare file in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contenuti dei pack di traduzione ==

* '''kain''' - cartella base
** '''locales'''
*** ''localename.nsx'' - testo di descrizione della localizzazione
*** ''localename.tga'' - immagine relativa alla localizzazione nel menu delle lingue
*** '''locale/''' - cartella generale della localizzazione
**** '''localename/''' - cartella base della localizzazione
**** '''fonts/''' - file di definizione dei font e del loro aspetto (vedere [[NSX_(QFont) | file QFONT]])
**** '''maps/''' - righe di traduzione testi della mappa (vedere [[NSX | file NSX]])
**** '''video/'''- traduzione sottotitoli per le cinematiche (vedere [[DPSUBS | file DPSUBS]])
**** ''credits.nsx'' - [[NSX (Translation string files) | righe di traduzione]] per i titoli di coda
**** ''gameover.nsx'' - righe di traduzione per la schermata di game over
**** ''gamestats.nsx'' - righe di traduzione per le statistiche della partita
**** ''menu.nsx'' - righe di traduzione per i menu
**** ''prestige.nsx'' - righe di traduzione per la classificazione del giocatore
**** ''speech.nsx'' - righe di traduzione per i dialoghi
**** ''ui.ns2'' - inizializzazione interfaccia utente (vedere [[NS2|file NS2]])

== Come fare una traduzione ==

# Scaricare un pack campione;
# Decomprimerlo in modo da avere accesso ai file
# Rinominarlo nella propria lingua
# Trovare font .TTF/.OTF che vanno bene per la lingua e aggiungerli al pack (sostituendo i font originali)
# Tradurre tutti file con delle righe di testo (.nsx)
# Tradurre i sottotitoli alle cinematiche (.dpsubs)
# Tradurre l'ui.ns2
# Creare una mappa con le didascalie tradotte
# Creare un'immagine da mettere nel menu di selezione lingua
# Modificare il testo di descrizione della localizzazione (con autore e versione)
# (Opzionale) Aggiungere i file alternativi di dialogo
# (Opzionale) Aggiungere i file dell'audio alternativo delle cinematiche
# Creare un file [[PK3]];

== Tag interattive per il parlato ==
Ci sono due modalità possibili per i sottotitoli al parlato - classica e interattiva. La modalità classica mostra i sottotitoli nella parte bassa dello schermo, quella interattiva sopra ai personaggi che stanno parlando.

La modalità interattiva è leggermente diversa nell'aspetto, quindi ci sono tag speciali per permettere che il discorso venga mostrato nella modalità migliore:

* {testo} - verrà mostrato solo nella modalità classica
* [testo] - verrà mostrato solo nella modalità interattiva
* &lt;numero&gt; - marker temporale per le porzioni dei sottotitoli interattivi. &quot;una&lt;3&gt;frase&quot; separerà i sottotitoli in due, con la seconda parte che subentrerà 3 secondi dopo l'inizio del parlato.

== Testare il parlato nel gioco ==
{{cmd|cl_cmd playspeech &lt;tipo&gt; &lt;personaggio&gt; &lt;numero&gt;| questo comando della [[console]] aiuta a testare tutti i dialoghi della mappa corrente.}}

I tipi sono:
*speech - dialogo standard
*whisp - voci &quot;nella testa di Kain&quot; (ad esempio i commenti di Mortanius), sempre mostrati nella modalità classica

== Pack di localizzazione campione ==
Questo è l'elenco dei pack di localizzazione di riferimento che possono essere usati come base:

''' Blood Omnicide v0.1  '''

:Inglese: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Usano il vecchio layout di traduzione)
:Inglese: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russo: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Spagnolo: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{initalian|Pack di traduzione}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Sistema dei materiali di DarkPlaces</title>
    <ns>0</ns>
    <id>653</id>
      <sha1>6qio6sfj1an783x5ivajsyynefp1tsa</sha1>
    <revision>
      <id>3627</id>
      <timestamp>2013-03-23T20:40:09Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;Il sistema dei materiali di Darkplaces è pensato per dare un maggiore controllo sulle qualità delle superfici delle texture. Questa guida contiene tutte le informazioni nece...&quot;</comment>
      <text xml:space="preserve" bytes="1114">Il sistema dei materiali di Darkplaces è pensato per dare un maggiore controllo sulle qualità delle superfici delle texture. Questa guida contiene tutte le informazioni necessarie per lavorare con i materiali di Darkplaces.

Dato che il sistema di materiali di Darkplaces è ispirato allo [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm shader system di Quake 3] e che Blood Omnicide usa dei [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2] per costruire le mappe, questa guida è basata sulla documentazione di Quake 3/Q3map2, ma adattata ed estesa alle caratteristiche specifiche di Darkplaces.

== Capitoli ==
&lt;font size=3&gt;
#[[Darkplaces material system/Introduction | Introduzione]]
#[[Darkplaces material system/Key Concepts | Concetti chiave]]
#[[Darkplaces material system/General Keywords | Parole chiave generali]]
#[[Darkplaces material system/Special Keywords | Parole chiave speciali]]
#[[Darkplaces material system/Stages | Passaggi]]
&lt;/font&gt;

__NOTOC__
[[Category:InItalian/Motore grafico DarkPlaces]]
{{initalian|Sistema dei materiali di DarkPlaces}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3655</id>
      <timestamp>2013-07-06T11:56:35Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1140">Il sistema dei materiali di Darkplaces è pensato per dare un maggiore controllo sulle qualità delle superfici delle texture. Questa guida contiene tutte le informazioni necessarie per lavorare con i materiali di Darkplaces.

Dato che il sistema di materiali di Darkplaces è ispirato allo [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm shader system di Quake 3] e che Blood Omnicide usa dei [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2] per costruire le mappe, questa guida è basata sulla documentazione di Quake 3/Q3map2, ma adattata ed estesa alle caratteristiche specifiche di Darkplaces.

== Capitoli ==
&lt;font size=3&gt;
#[[Portal:InItalian/Sistema dei materiali di DarkPlaces/Introduzione | Introduzione]]
#[[Darkplaces material system/Key Concepts | Concetti chiave]]
#[[Darkplaces material system/General Keywords | Parole chiave generali]]
#[[Darkplaces material system/Special Keywords | Parole chiave speciali]]
#[[Darkplaces material system/Stages | Passaggi]]
&lt;/font&gt;

__NOTOC__
[[Category:InItalian/Motore grafico DarkPlaces]]
{{initalian|Sistema dei materiali di DarkPlaces}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3657</id>
      <timestamp>2013-07-11T10:30:27Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1261">Il sistema dei materiali di DarkPlaces è pensato per dare un maggiore controllo sulle qualità delle superfici delle texture. Questa guida contiene tutte le informazioni necessarie per lavorare con i materiali di DarkPlaces.

Dato che il sistema di materiali di DarkPlaces è ispirato allo [http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/index.htm shader system di Quake 3] e che Blood Omnicide usa dei [http://q3map2.everyonelookbusy.net/shader_manual/ Q3Map2] per costruire le mappe, questa guida è basata sulla documentazione di Quake 3/Q3map2, ma adattata ed estesa alle caratteristiche specifiche di DarkPlaces.

== Capitoli ==
&lt;font size=3&gt;
#[[Portal:InItalian/Sistema dei materiali di DarkPlaces/Introduzione | Introduzione]]
#[[Portal:InItalian/Sistema dei materiali di DarkPlaces/Concetti chiave | Concetti chiave]]
#[[Portal:InItalian/Sistema dei materiali di DarkPlaces/Parole chiave generali | Parole chiave generali]]
#[[Portal:InItalian/Sistema dei materiali di DarkPlaces/Parole chiave speciali | Parole chiave speciali]]
#[[Portal:InItalian/Sistema dei materiali di DarkPlaces/Passaggi | Passaggi]]
&lt;/font&gt;

__NOTOC__
[[Category:InItalian/Motore grafico DarkPlaces]]
{{initalian|Sistema dei materiali di DarkPlaces}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Sistema dei materiali di DarkPlaces/Concetti chiave</title>
    <ns>0</ns>
    <id>659</id>
      <sha1>3d5kuejpsxqofn4xxlpziv2sw1mqc6s</sha1>
    <revision>
      <id>3659</id>
      <timestamp>2013-07-11T10:35:00Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;{{Capitolo precedente|Introduzione}} In teoria un designer o un artista grafico che altera delle texture con dei file dei materiali dovrebbe avere una comprensione minima dell...&quot;</comment>
      <text xml:space="preserve" bytes="9466">{{Capitolo precedente|Introduzione}}
In teoria un designer o un artista grafico che altera delle texture con dei file dei materiali dovrebbe avere una comprensione minima delle forme d'onda e dovrebbe sapere come mescolare luci colorate (è roba che bene o male si fa alle superiori nelle lezioni di fisica). Se così non è, ecco alcuni concetti che bisogna saper padroneggiare per ottenere dei materiali ben funzionanti.

I materiali non modificano solo l'aspetto visibile della texture su un [[Brush | pennello]] geometrico, una [[Patch mesh | curva]] o la mesh di un modello; possono anche avere effetto sul contenuto, la &quot;forma&quot; o il movimento apparente di queste cose. L'effetto di una superficie non fa nulla per modificare la forma o il contenuto di un pennello. Sono effetti delle superfici ad esempio i glow (bagliori), le trasparenze e i cambiamenti dei valori RGB (rosso, verde, blu). I content material hanno effetto sul modo in cui il pennello opera nel mondo di gioco. Alcuni esempi sono l'acqua, i non-solidi e il dettaglio. Gli effetti di deformazione modificano la forma effettiva del pennello o della curva a cui sono applicati, e possono far sembrare che si stia muovendo.

== Il potere ha un prezzo ==
Lo script del materiale dà al designer, artista o programmatore un notevole potere in termini di facile accesso sull'aspetto delle superfici del mondo di gioco e sui potenziali effetti speciali che potrebbero essere applicati ad esse. Ma è un potere che ha un prezzo, in termini di velocità di performance. Molti effetti OpenGL 2.0 legati alle parole chiave dei materiali (come [[water shader]], [[refraction]] cubemap, [[offset mapping]]) danno al renderer più calcoli da fare, il che fa impiegare più tempo alla CPU/GPU e rallentano il gioco. La superficie dello shader per l'acqua disegna un mondo due volte per ottenere un'immagine riflessiva e una refrattiva, la refraction cubemap aggiunge un texture sampler, la parallax mapping crea più look-up delle texture (da 3 per l'offset mapping tradizionale a 14-15 per il relief mapping). Le superfici con un blending vengono disegnate due volte se sono illuminate da una o più luci in tempo reale (questo significa che il numero dei loro triangoli avrà un effetto doppio sulla r_speeds).

== Colore RGB ==
RGB sta per &quot;Red, Green, Blue&quot;, ovvero &quot;rosso, verde, blu&quot;. Mescolare luci rosse, verdi e blu ad intensità diverse produce tutti i colori nei computer e nei monitor dei televisori. Questo metodo si chiama mescolanza additiva (ben diversa dal mescolare pigmenti nei dipinti o inchiostri colorati nei processi di stampa, che si basano su una mescolanza sottrattiva). Nel motore grafico DarkPlaces e in quasi tutti i programmi grafici per pc di fascia alta (e nel software di scelta dei colori di Windows) le intensità individuali delle componenti di rosso, verde e blu vengono espresse con valori numerici. Quando mescolati insieme su schermo, valori numerici identici per ogni componente cromatica producono un colore completamente neutrale (ovvero un grigio). Più è basso il valore (minimo 0), più la tinta è scura. Più è alto, più il risultato è chiaro o più il colore è saturato, fino ad un valore massimo di 255 (nei programmi grafici). Tutti i colori possibili in un computer possono essere espressi con l'unione di questi tre numeri. Il valore per il nero è 0 0 0. Il valore per il bianco puro è 255 255 255. Ad ogni modo, il comparto grafico di DarkPlaces ha bisogno che tutti i valori dei colori siano &quot;normalizzati&quot; in un intervallo da 0.0 a 1.0. 
{{consiglio|spesso si trova l'abbreviazione RGBA, che sta per &quot;RGB + alpha&quot;. Si tratta di un colore RGB con un canale aggiuntivo, quello per la trasparenza. Le immagini a 32 bit sono RGBA, mentre quelle a 24 bit sono RGB.}}

== Normalizzazione: una scala da 0 a 1 ==
Il motore grafico DarkPlaces utilizza valori numerici da 0.0 a 1.0 invece che da 0 a 255. Quasi tutti i programmi grafici per computer che permettono di lavorare coi valori RGB come numeri usano la scala da 0 a 255. Per convertirli, dividete ogni valore del colore usato dal programma di grafica per 255. I tre valori risultanti sono la terna con cui DarkPlaces riprodurrà lo stesso colore di prima. Questo stesso discorso vale anche per le [[coordinate delle texture]].

== Dimensioni delle texture ==
I file delle texture sono misurati in pixel. Le texture sono misurate in potenze di 2, con la (generalmente) più piccola texture utilizzata di 16x16 pixel. Quasi tutte saranno più grandi di così. Non serve che le texture siano quadrate, basta che entrambe le dimensioni siano potenze di 2. Alcuni esempi di dimensioni valide: 32x256, 16x32, 128x16.

== Misurazioni ==
Le misurazioni usate per i materiali possono essere in unità di misura di gioco, di colore o per coordinate delle texture.

=== Unità di gioco ===
:L'unità di gioco viene usata per le deformazioni, per specificare le dimensioni in relazione al mondo. In Blood Omnicide 16 unità corrispondono a un piede, 48 unità a un metro. La scala di base delle texture usata dall'editor di mappe NetRadiant equivale a due texel (o &quot;texture element&quot;, o ancora &quot;texture pixel&quot;) per ogni unità di gioco, ma si può alterare liberamente questo valore con gli script per i materiali.

=== Unità di colore ===
:I colori scalano i valori generati dalle unità di texture per produrre effetti di illuminazione; lavorano come un canale alpha. Un valore di 0.0 dà un risultato completamente nero, e un valore di 1.0 lascia la texture inalterata. I colori vengono specificati a volte da un singolo valore che rappresenta tutti e tre i canali (rosso, verde e blu) e altre volte da valori separati per ogni canale.

=== [[Coordinate delle texture]] ===
:Sono le dimensioni normalizzate (vedere prima) dell'immagine originale della texture. Una texture completa, indipendentemente dalla sua dimensione originale in texel, ha una misura normalizzata di 1.0x1.0. Per texture che si ripetono in modo semplice è possibile avere valori superiori a 1.0 o minori di 0.0, che daranno come risultato la ripetizione della texture. Le cordinate vengono generalmente assegnate dall'editor di livelli o dai tool di modellazione, ma è comunque importante saperlo in funzione di scorrimenti o movimenti molto rapidi della texture mentre il gioco è eseguito.

== Funzioni delle forme d'onda ==

Alcune funzioni per il rendering dei materiali usano delle forme d'onda per modulare i valori nel tempo. Quando necessario, informazioni aggiuntive vengono date con funzioni sotto forma di parole chiave modulate da onde per descrivere l'effetto di una particolare forma d'onda. Al momento ci sono cinque forme d'onda usate negli script dei materiali:

* '''seno''': una funzione seno, un'onda regolare che avanza dolcemente e si estende da -1 a 1.
* '''triangolare''': un'onda triangolare cresce e cala rigidamente, andando da 0 a 1. Genera delle fomre d'onda dall'aspetto incostante.
* '''quadrata''': un'onda quadrata passa semplicemente da -1 a 1 senza valori intermedi.
* '''dente di sega''': in un'onda a dente di sega la porzione ascendente è simile ad un'onda triangolare che va da 0 a 1, ma la parte discendente torna a 0 immediatamente.
* '''dente di sega inverso''': è il contrario di una dente di sega: ascesa istantanea fino al valore massimo (1), poi un'onda triangolare discendente fino al valore minimo (0). La fase di questo tipo di onda va da 1.0 a 0.0 invece che da 0.0 a 1.0. Questo tipo di onda è particolarmente utile per dei cross-fade additivi.

Tutte le forme d'onda hanno le seguenti proprietà:

'''base'''
:Dove ha inizio la forma d'onda. L'ampiezza si misura partendo dal valore della base.

'''ampiezza''' 
:E' l'altezza dell'onda che si forma, misurata partendo dalla base. Probabilmente dovrete testare e aggiustare questo valore per ottenere quello corretto per ogni nuovo stage dello shader. Maggiore è l'ampiezza, più l'onda è prominente nei picchi e profonda nelle valli.

'''fase'''
:E' un valore normalizzato compreso tra 0.0 e 1.0. Cambiare la fase in un valore diverso da 0 influenza il punto sull'onda in cui la forma d'onda inizia a venire disegnata. Esempio: In un'onda seno o triangolare, una fase di 0.25 significa che l'onda stessa inizia a un quarto (25%) della distanza lungo la curva, o, per dirla in modo più semplice, inizia al picco dell'onda. Una fase di 0.5 la farebbe iniziare nel punto in cui l'onda stessa ri-attraversa la riga della base. Una base di 0.75 equivarrebbe al punto più basso della valle. Se per un materiale viene usata una sola forma d'onda un'alterazione della fase probabilmente non avrà effetti visibili, quindi sarebbe meglio lasciare il valore a zero (0). Se invece sono presenti due o più stage dello stesso processo in un unico materiale, ma con le fasi diverse, si possono ottenere effetti visivi interessanti. I cambiamenti di fase possono anche essere utilizzati quando si usa due volte lo stesso effetto in punti vicini e non si vuole che siano sincronizzati. Conviene scrivere un materiale diverso per ognuno, con la sola fase diversa.

'''frequenza'''
:Questo valore viene espresso in termini di ripetizioni (o cicli) dell'onda ogni secondo. Un valore di 1 significa che l'onda si ripete 1 volta ogni secondo. Un valore di 10 che si ripete 10 volte ogni secondo. Un valore di 0.1 che si ripete 1 volta ogni 10 secondi.

{{Capitolo successivo|Parole chiave generali}}
{{finished}}
{{initalian|Concetti chiave}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Sistema dei materiali di DarkPlaces/Introduzione</title>
    <ns>0</ns>
    <id>658</id>
      <sha1>47hl5q8t9znpxqgci9m26xlihlhpczz</sha1>
    <revision>
      <id>3654</id>
      <timestamp>2013-07-06T11:55:19Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;{{capitolo precedente|}}  == Cos'è un materiale? == I materiali sono brevi script testuali che definiscono le proprietà di una superficie in termini di come appare e delle s...&quot;</comment>
      <text xml:space="preserve" bytes="8369">{{capitolo precedente|}}

== Cos'è un materiale? ==
I materiali sono brevi script testuali che definiscono le proprietà di una superficie in termini di come appare e delle sue funzioni nel mondo di gioco (o un tool di modifica compatibile). Convenzionalmente i documenti che contengono questi script hanno lo stesso nome dei file in cui si trova la texture che viene modificata (es: textures_inn, models_mapobjects_crypt ecc.). Diversi documenti con script specifici sono anche stati creati per gestire casi particolari, come i liquidi, gli ambienti e gli effetti speciali.

Per Darkplaces, gli script dei materiali sono in 'Path_To_The_Game/gamedir/scripts'.

Il file di un materiale di Darkplaces consiste in una serie di attributi della superficie e di istruzioni per il render, scritte tra parentesi (&quot;{&quot; e &quot;}&quot;). Qui sotto c'è un esempio di semplice sinttassi e formattazione per un singolo procedimento, incluse le parole chiavi in [[Q3map | Q3MAP]], o &quot;parametri per le superfici&quot;, che seguono la prima parentesi e un singolo &quot;livello&quot; tra parentesi:

 &lt;font color=green&gt;// Definizione del materiale&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parole chiave&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// stage di base&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// il motore grafico cercherà textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// stage dell'illuminazione&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Nomi dei materiali e convenzioni ==
La prima riga è il nome del materiale. I nomi dei materiali possono essere lunghi fino a 63 caratteri. I nomi sono spesso identici al percorso fino ad un file .tga senza estensione o cartella alla radice (/Blood Omnicide/kain nel nostro caso), ma non serve che queste cose ci siano.

I materiali che verranno gestiti unicamente dal codice di gioco, non dai tool di modellazione, sono spesso una sola parola, come &quot;collision&quot; o &quot;dpbihclip&quot;.

I materiali usati sui personaggi o su altri modelli poligonali devono corrispondere ad un file .tga, per permettere ai modellisti di creare delle normal texture e quindi di far apparire gli effetti speciali nel gioco quando il modello viene caricato.

I materiali posizionati su delle superfici nell'editor delle mappe generalmente corrispondono a un file .tga, ma il parametro del materiale &quot;qer_editorimage&quot; può far mostrare all'editor un'immagine a piaciere.

I percorsi dei nomi dei materiali distinguono maiuscole e minuscole - nelle finestre questo non avviene, ma succede in unix. Meglio cercare di usare sempre e solo minuscole per i nomi dei file, e sempre barre del tipo &quot;/&quot; per i separatori del percorso delle cartelle.

=== Formattazione degli scripr dei materiali ===

Affinché i materiali siano facilmente leggibili e modificabili è consigliato formattare tutti gli script dei materiali come segue:

 &amp;lt;nomedelmateriale&amp;gt;
 {
     &amp;lt;Parole chiave specifiche dell'editor&amp;gt;
 
     &amp;lt;Parole chiave specifiche di Q3Map2&amp;gt;
     &amp;lt;Parole chiave generiche&amp;gt;
     {
          &amp;lt;Parole chiave dello stage&amp;gt;
     }
 }

== Ispirati a Quake 3, ma diversi ==
Gli script degli shader di Quake 3 sono stati d'ispirazione per il sistema di materiali di Darkplaces e l'aspetto degli script dei materiali è davvero molto simile a quello degli equivalenti in Quake 3. Quindi, se siete pratici con il sistema di [[Shader | shaders]] di Id Tech 3 vi sentirete a casa con la sintassi degli script dei materiali. Ad ogni modo, il sistema di materiali di Darkplaces è stato scritto indipendentemente e presenta alcune importanti differenze:

=== Illuminazione in tempo reale ===
Ogni parola chiave degli shader non compatibile con l'illuminazione in tempo reale è stata eliminata. Alcune altre hanno un comportamento leggermente diverso dall'originale.

Puntare ad un'illuminazione in tempo reale cambia il modo in cui funzionano gli stage. Non ci sono passaggi di render (quindi i materiali a più strati possono essere creati solo duplicando delle superfici reali). 
La catena del render dei materiali di Darkplaces può usare da 1 a 3 utilizzi prefissati degli stage:
* Nessun disegno (0 stage)
* Texture non illuminata (1 stage)
* Texture illuminata (2 stage)
* Texture illuminata con blending di un terreno (3 stage)

Ogni altra configurazione di stage di Id Tech 3, come i cieli, non è supportata.

{{design|Per simulare materiali a più livelli bisogna fare diverse copie della superficie con assegnati diversi materiali (per le superfici della mappa si può usare la parola chiave di Q3map2 cloneShader)}}

=== Nuove parole chiave ===
Darkplaces aggiunge diverse parole chiave proprie che non esistono in Id Tech 3.

=== Texture Q3 = skinframe Darkplaces ===
Id tech 3 ha bisogno solo di informazioni sui colori per le texture. Il motore grafico Darkplaces usa normal map, mspecularity map, texture di glow e altre texture che contengono informazioni aggiuntive. Tutti questi file di texture messi insieme (colori + normal map + gloss map + glow ecc.) formano lo skinframe. 
Per ulteriori dettagli leggere la pagina sulle [[texture]].

=== Costi diversi in velocità ===
La catena di rendering del motore grafico Darkplaces è molto diversa da quella di Id Tech 3. Con l'utilizzo di shader di pixel e vertici essa aggiunge nuovi parametri di velocità che non esistono in Id Tech 3:
* intruzioni degli shader - numero di istruzioni per vertex shader e pixel shader generate per un materiale particolare (dipende dagli effetti usati)
* look-up delle texture - numero dei look-up delle texture nel pixel shader, texture aggiuntive in uno skinframe, aumento del numero di look-up delle texture del parallax mapping
* uso del VBO - i modelli non animati vengono renderizzati più velocemente col VBO; alcune parole chiave degli shader (ad esempio tcMod turbulent, deformVertexes) disabilitano il VBO 
* uso dell'illuminazione - la luce in tempo reale è più lenta per i blending (aggiunge più disegni sulla superficie, uno per luce) o le superfici su cui si applica un offset mapping (l'offset mapping viene elaborato di nuovo per ogni singola luce) 

=== Il materiale è detto 'shader' ===
Dato che Darkplaces usa dei tool derivati da Id Tech 3 i materiali sono spesso chiamati 'shader' da essi. Per non fare confusione, questi termini sono equivalenti nei tool di Q3:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Tipi di materiali ==
La parole chiave che agiscono sui materiali sono divise in tre classi. La prima è quella dei parametri globali. Alcuni parametri globali (le &quot;surfaceparm&quot; e tutte le parole chiave &quot;q3map_&quot;) sono elaborate da [[Q3Map2 | Q3MAP2]] e cambiano gli attributi fisici della superficie che usa il materiale. Questi attributi possono avere effetto sul giocatore. Per vedere i cambiamenti in questi parametri bisogna ricompilare la  [[MAP | mappa]].

Quelle della seconda classe sono le parole chiave compilate dalla parte server del motore grafico (le &quot;surfaceparm&quot;, alcune altre parole chiave). Modificano le proprietà fisiche della superficie e possono avere effetto sul gameplay.

Tutte le altre parole chiavi globali e tutte le Stage Specific Keywords (parole chiavi specifiche dello stage) vengono elaborate dal renderer. Riguardano solo cambiamenti di aspetto e non hanno effetto sul gameplay o sulle meccaniche di gioco. Le modifiche a questi attributi avranno effetto non appena il gioco passa ad un altro livello o gli si dice di operare un vid_restart (scrivere il comando &quot;vid_restart&quot; nella [[Console | console]] di gioco).

Le parole chiave dei materiali funzionano indifferentemente con maiuscole e minuscole.

{{importante|alcuni dei comandi dei materiali potrebbero dipendere dall'ordine in cui li si dà, quindi è buona abitudine mettere tutti i comandi globali dei materiali (le parole chiave definite in questa sezione) all'inizio dei materiali e gli stage dei materiali alla fine.}}

{{capitolo successivo|Concetti chiave}}
{{finished}}
{{initalian|Introduzione}}</text>
    </revision>
    <revision>
      <id>3656</id>
      <timestamp>2013-07-06T11:57:40Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* Tipi di materiali */</comment>
      <text xml:space="preserve" bytes="8383">{{capitolo precedente|}}

== Cos'è un materiale? ==
I materiali sono brevi script testuali che definiscono le proprietà di una superficie in termini di come appare e delle sue funzioni nel mondo di gioco (o un tool di modifica compatibile). Convenzionalmente i documenti che contengono questi script hanno lo stesso nome dei file in cui si trova la texture che viene modificata (es: textures_inn, models_mapobjects_crypt ecc.). Diversi documenti con script specifici sono anche stati creati per gestire casi particolari, come i liquidi, gli ambienti e gli effetti speciali.

Per Darkplaces, gli script dei materiali sono in 'Path_To_The_Game/gamedir/scripts'.

Il file di un materiale di Darkplaces consiste in una serie di attributi della superficie e di istruzioni per il render, scritte tra parentesi (&quot;{&quot; e &quot;}&quot;). Qui sotto c'è un esempio di semplice sinttassi e formattazione per un singolo procedimento, incluse le parole chiavi in [[Q3map | Q3MAP]], o &quot;parametri per le superfici&quot;, che seguono la prima parentesi e un singolo &quot;livello&quot; tra parentesi:

 &lt;font color=green&gt;// Definizione del materiale&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parole chiave&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// stage di base&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// il motore grafico cercherà textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// stage dell'illuminazione&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Nomi dei materiali e convenzioni ==
La prima riga è il nome del materiale. I nomi dei materiali possono essere lunghi fino a 63 caratteri. I nomi sono spesso identici al percorso fino ad un file .tga senza estensione o cartella alla radice (/Blood Omnicide/kain nel nostro caso), ma non serve che queste cose ci siano.

I materiali che verranno gestiti unicamente dal codice di gioco, non dai tool di modellazione, sono spesso una sola parola, come &quot;collision&quot; o &quot;dpbihclip&quot;.

I materiali usati sui personaggi o su altri modelli poligonali devono corrispondere ad un file .tga, per permettere ai modellisti di creare delle normal texture e quindi di far apparire gli effetti speciali nel gioco quando il modello viene caricato.

I materiali posizionati su delle superfici nell'editor delle mappe generalmente corrispondono a un file .tga, ma il parametro del materiale &quot;qer_editorimage&quot; può far mostrare all'editor un'immagine a piaciere.

I percorsi dei nomi dei materiali distinguono maiuscole e minuscole - nelle finestre questo non avviene, ma succede in unix. Meglio cercare di usare sempre e solo minuscole per i nomi dei file, e sempre barre del tipo &quot;/&quot; per i separatori del percorso delle cartelle.

=== Formattazione degli scripr dei materiali ===

Affinché i materiali siano facilmente leggibili e modificabili è consigliato formattare tutti gli script dei materiali come segue:

 &amp;lt;nomedelmateriale&amp;gt;
 {
     &amp;lt;Parole chiave specifiche dell'editor&amp;gt;
 
     &amp;lt;Parole chiave specifiche di Q3Map2&amp;gt;
     &amp;lt;Parole chiave generiche&amp;gt;
     {
          &amp;lt;Parole chiave dello stage&amp;gt;
     }
 }

== Ispirati a Quake 3, ma diversi ==
Gli script degli shader di Quake 3 sono stati d'ispirazione per il sistema di materiali di Darkplaces e l'aspetto degli script dei materiali è davvero molto simile a quello degli equivalenti in Quake 3. Quindi, se siete pratici con il sistema di [[Shader | shaders]] di Id Tech 3 vi sentirete a casa con la sintassi degli script dei materiali. Ad ogni modo, il sistema di materiali di Darkplaces è stato scritto indipendentemente e presenta alcune importanti differenze:

=== Illuminazione in tempo reale ===
Ogni parola chiave degli shader non compatibile con l'illuminazione in tempo reale è stata eliminata. Alcune altre hanno un comportamento leggermente diverso dall'originale.

Puntare ad un'illuminazione in tempo reale cambia il modo in cui funzionano gli stage. Non ci sono passaggi di render (quindi i materiali a più strati possono essere creati solo duplicando delle superfici reali). 
La catena del render dei materiali di Darkplaces può usare da 1 a 3 utilizzi prefissati degli stage:
* Nessun disegno (0 stage)
* Texture non illuminata (1 stage)
* Texture illuminata (2 stage)
* Texture illuminata con blending di un terreno (3 stage)

Ogni altra configurazione di stage di Id Tech 3, come i cieli, non è supportata.

{{design|Per simulare materiali a più livelli bisogna fare diverse copie della superficie con assegnati diversi materiali (per le superfici della mappa si può usare la parola chiave di Q3map2 cloneShader)}}

=== Nuove parole chiave ===
Darkplaces aggiunge diverse parole chiave proprie che non esistono in Id Tech 3.

=== Texture Q3 = skinframe Darkplaces ===
Id tech 3 ha bisogno solo di informazioni sui colori per le texture. Il motore grafico Darkplaces usa normal map, mspecularity map, texture di glow e altre texture che contengono informazioni aggiuntive. Tutti questi file di texture messi insieme (colori + normal map + gloss map + glow ecc.) formano lo skinframe. 
Per ulteriori dettagli leggere la pagina sulle [[texture]].

=== Costi diversi in velocità ===
La catena di rendering del motore grafico Darkplaces è molto diversa da quella di Id Tech 3. Con l'utilizzo di shader di pixel e vertici essa aggiunge nuovi parametri di velocità che non esistono in Id Tech 3:
* intruzioni degli shader - numero di istruzioni per vertex shader e pixel shader generate per un materiale particolare (dipende dagli effetti usati)
* look-up delle texture - numero dei look-up delle texture nel pixel shader, texture aggiuntive in uno skinframe, aumento del numero di look-up delle texture del parallax mapping
* uso del VBO - i modelli non animati vengono renderizzati più velocemente col VBO; alcune parole chiave degli shader (ad esempio tcMod turbulent, deformVertexes) disabilitano il VBO 
* uso dell'illuminazione - la luce in tempo reale è più lenta per i blending (aggiunge più disegni sulla superficie, uno per luce) o le superfici su cui si applica un offset mapping (l'offset mapping viene elaborato di nuovo per ogni singola luce) 

=== Il materiale è detto 'shader' ===
Dato che Darkplaces usa dei tool derivati da Id Tech 3 i materiali sono spesso chiamati 'shader' da essi. Per non fare confusione, questi termini sono equivalenti nei tool di Q3:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Tipi di materiali ==
La parole chiave che agiscono sui materiali sono divise in tre classi. La prima è quella dei parametri globali. Alcuni parametri globali (le &quot;surfaceparm&quot; e tutte le parole chiave &quot;q3map_&quot;) sono elaborate da [[Q3Map2 | Q3MAP2]] e cambiano gli attributi fisici della superficie che usa il materiale. Questi attributi possono avere effetto sul giocatore. Per vedere i cambiamenti in questi parametri bisogna ricompilare la  [[MAP | mappa]].

Quelle della seconda classe sono le parole chiave compilate dalla parte server del motore grafico (le &quot;surfaceparm&quot;, alcune altre parole chiave). Modificano le proprietà fisiche della superficie e possono avere effetto sul gameplay.

Tutte le altre parole chiavi globali e tutte le Stage Specific Keywords (parole chiavi specifiche dello stage) vengono elaborate dal renderer. Riguardano solo cambiamenti di aspetto e non hanno effetto sul gameplay o sulle meccaniche di gioco. Le modifiche a questi attributi avranno effetto non appena il gioco passa ad un altro livello o gli si dice di operare un vid_restart (scrivere il comando &quot;vid_restart&quot; nella [[Portal:InItalian/Cvar | console]] di gioco).

Le parole chiave dei materiali funzionano indifferentemente con maiuscole e minuscole.

{{importante|alcuni dei comandi dei materiali potrebbero dipendere dall'ordine in cui li si dà, quindi è buona abitudine mettere tutti i comandi globali dei materiali (le parole chiave definite in questa sezione) all'inizio dei materiali e gli stage dei materiali alla fine.}}

{{capitolo successivo|Concetti chiave}}
{{finished}}
{{initalian|Introduzione}}</text>
    </revision>
    <revision>
      <id>3658</id>
      <timestamp>2013-07-11T10:31:09Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="8383">{{capitolo precedente|}}

== Cos'è un materiale? ==
I materiali sono brevi script testuali che definiscono le proprietà di una superficie in termini di come appare e delle sue funzioni nel mondo di gioco (o un tool di modifica compatibile). Convenzionalmente i documenti che contengono questi script hanno lo stesso nome dei file in cui si trova la texture che viene modificata (es: textures_inn, models_mapobjects_crypt ecc.). Diversi documenti con script specifici sono anche stati creati per gestire casi particolari, come i liquidi, gli ambienti e gli effetti speciali.

Per DarkPlaces, gli script dei materiali sono in 'Path_To_The_Game/gamedir/scripts'.

Il file di un materiale di DarkPlaces consiste in una serie di attributi della superficie e di istruzioni per il render, scritte tra parentesi (&quot;{&quot; e &quot;}&quot;). Qui sotto c'è un esempio di semplice sinttassi e formattazione per un singolo procedimento, incluse le parole chiavi in [[Q3map | Q3MAP]], o &quot;parametri per le superfici&quot;, che seguono la prima parentesi e un singolo &quot;livello&quot; tra parentesi:

 &lt;font color=green&gt;// Definizione del materiale&lt;/font&gt;
 '''textures/crypt/stone'''
 {
    &lt;font color=green&gt;// parole chiave&lt;/font&gt;
    &lt;font color=blue&gt;qer_editorImage&lt;/font&gt; '''radiant/textures/crypt/stone'''
 
    &lt;font color=blue&gt;surfaceparm&lt;/font&gt; '''stone'''
    &lt;font color=blue&gt;dpglossexponentmod&lt;/font&gt; 0.5
    &lt;font color=green&gt;// stage di base&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''textures/crypt/stone''' &lt;font color=green&gt;// il motore grafico cercherà textures/mymaterial.tga, textures/mymaterial.jpeg&lt;/font&gt;
    }
    &lt;font color=green&gt;// stage dell'illuminazione&lt;/font&gt;
    {
        &lt;font color=blue&gt;map&lt;/font&gt; '''$lightmap'''
    }
 }

== Nomi dei materiali e convenzioni ==
La prima riga è il nome del materiale. I nomi dei materiali possono essere lunghi fino a 63 caratteri. I nomi sono spesso identici al percorso fino ad un file .tga senza estensione o cartella alla radice (/Blood Omnicide/kain nel nostro caso), ma non serve che queste cose ci siano.

I materiali che verranno gestiti unicamente dal codice di gioco, non dai tool di modellazione, sono spesso una sola parola, come &quot;collision&quot; o &quot;dpbihclip&quot;.

I materiali usati sui personaggi o su altri modelli poligonali devono corrispondere ad un file .tga, per permettere ai modellisti di creare delle normal texture e quindi di far apparire gli effetti speciali nel gioco quando il modello viene caricato.

I materiali posizionati su delle superfici nell'editor delle mappe generalmente corrispondono a un file .tga, ma il parametro del materiale &quot;qer_editorimage&quot; può far mostrare all'editor un'immagine a piaciere.

I percorsi dei nomi dei materiali distinguono maiuscole e minuscole - nelle finestre questo non avviene, ma succede in unix. Meglio cercare di usare sempre e solo minuscole per i nomi dei file, e sempre barre del tipo &quot;/&quot; per i separatori del percorso delle cartelle.

=== Formattazione degli scripr dei materiali ===

Affinché i materiali siano facilmente leggibili e modificabili è consigliato formattare tutti gli script dei materiali come segue:

 &amp;lt;nomedelmateriale&amp;gt;
 {
     &amp;lt;Parole chiave specifiche dell'editor&amp;gt;
 
     &amp;lt;Parole chiave specifiche di Q3Map2&amp;gt;
     &amp;lt;Parole chiave generiche&amp;gt;
     {
          &amp;lt;Parole chiave dello stage&amp;gt;
     }
 }

== Ispirati a Quake 3, ma diversi ==
Gli script degli shader di Quake 3 sono stati d'ispirazione per il sistema di materiali di DarkPlaces e l'aspetto degli script dei materiali è davvero molto simile a quello degli equivalenti in Quake 3. Quindi, se siete pratici con il sistema di [[Shader | shaders]] di Id Tech 3 vi sentirete a casa con la sintassi degli script dei materiali. Ad ogni modo, il sistema di materiali di DarkPlaces è stato scritto indipendentemente e presenta alcune importanti differenze:

=== Illuminazione in tempo reale ===
Ogni parola chiave degli shader non compatibile con l'illuminazione in tempo reale è stata eliminata. Alcune altre hanno un comportamento leggermente diverso dall'originale.

Puntare ad un'illuminazione in tempo reale cambia il modo in cui funzionano gli stage. Non ci sono passaggi di render (quindi i materiali a più strati possono essere creati solo duplicando delle superfici reali). 
La catena del render dei materiali di DarkPlaces può usare da 1 a 3 utilizzi prefissati degli stage:
* Nessun disegno (0 stage)
* Texture non illuminata (1 stage)
* Texture illuminata (2 stage)
* Texture illuminata con blending di un terreno (3 stage)

Ogni altra configurazione di stage di Id Tech 3, come i cieli, non è supportata.

{{design|Per simulare materiali a più livelli bisogna fare diverse copie della superficie con assegnati diversi materiali (per le superfici della mappa si può usare la parola chiave di Q3map2 cloneShader)}}

=== Nuove parole chiave ===
DarkPlaces aggiunge diverse parole chiave proprie che non esistono in Id Tech 3.

=== Texture Q3 = skinframe DarkPlaces ===
Id tech 3 ha bisogno solo di informazioni sui colori per le texture. Il motore grafico DarkPlaces usa normal map, mspecularity map, texture di glow e altre texture che contengono informazioni aggiuntive. Tutti questi file di texture messi insieme (colori + normal map + gloss map + glow ecc.) formano lo skinframe. 
Per ulteriori dettagli leggere la pagina sulle [[texture]].

=== Costi diversi in velocità ===
La catena di rendering del motore grafico DarkPlaces è molto diversa da quella di Id Tech 3. Con l'utilizzo di shader di pixel e vertici essa aggiunge nuovi parametri di velocità che non esistono in Id Tech 3:
* intruzioni degli shader - numero di istruzioni per vertex shader e pixel shader generate per un materiale particolare (dipende dagli effetti usati)
* look-up delle texture - numero dei look-up delle texture nel pixel shader, texture aggiuntive in uno skinframe, aumento del numero di look-up delle texture del parallax mapping
* uso del VBO - i modelli non animati vengono renderizzati più velocemente col VBO; alcune parole chiave degli shader (ad esempio tcMod turbulent, deformVertexes) disabilitano il VBO 
* uso dell'illuminazione - la luce in tempo reale è più lenta per i blending (aggiunge più disegni sulla superficie, uno per luce) o le superfici su cui si applica un offset mapping (l'offset mapping viene elaborato di nuovo per ogni singola luce) 

=== Il materiale è detto 'shader' ===
Dato che DarkPlaces usa dei tool derivati da Id Tech 3 i materiali sono spesso chiamati 'shader' da essi. Per non fare confusione, questi termini sono equivalenti nei tool di Q3:
* Shader = Material 
* Shader name = Surface shader = Material name = Surface material
* Shader script = Material script
* Shader keywords = Material keywords
* etc.

== Tipi di materiali ==
La parole chiave che agiscono sui materiali sono divise in tre classi. La prima è quella dei parametri globali. Alcuni parametri globali (le &quot;surfaceparm&quot; e tutte le parole chiave &quot;q3map_&quot;) sono elaborate da [[Q3Map2 | Q3MAP2]] e cambiano gli attributi fisici della superficie che usa il materiale. Questi attributi possono avere effetto sul giocatore. Per vedere i cambiamenti in questi parametri bisogna ricompilare la  [[MAP | mappa]].

Quelle della seconda classe sono le parole chiave compilate dalla parte server del motore grafico (le &quot;surfaceparm&quot;, alcune altre parole chiave). Modificano le proprietà fisiche della superficie e possono avere effetto sul gameplay.

Tutte le altre parole chiavi globali e tutte le Stage Specific Keywords (parole chiavi specifiche dello stage) vengono elaborate dal renderer. Riguardano solo cambiamenti di aspetto e non hanno effetto sul gameplay o sulle meccaniche di gioco. Le modifiche a questi attributi avranno effetto non appena il gioco passa ad un altro livello o gli si dice di operare un vid_restart (scrivere il comando &quot;vid_restart&quot; nella [[Portal:InItalian/Cvar | console]] di gioco).

Le parole chiave dei materiali funzionano indifferentemente con maiuscole e minuscole.

{{importante|alcuni dei comandi dei materiali potrebbero dipendere dall'ordine in cui li si dà, quindi è buona abitudine mettere tutti i comandi globali dei materiali (le parole chiave definite in questa sezione) all'inizio dei materiali e gli stage dei materiali alla fine.}}

{{capitolo successivo|Concetti chiave}}
{{finished}}
{{initalian|Introduzione}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/TGA</title>
    <ns>0</ns>
    <id>643</id>
      <sha1>ni75lchgps2l3n1wfnwo3g4wvht3gif</sha1>
    <revision>
      <id>3568</id>
      <timestamp>2013-01-31T14:46:37Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;Questa estensione fa riferimento al formato di immagine [http://it.wikipedia.org/wiki/TGA_(formato_di_file)  Targa].   = Supportato dal formato =  {| width=300 cellspacing=0 c...&quot;</comment>
      <text xml:space="preserve" bytes="579">Questa estensione fa riferimento al formato di immagine [http://it.wikipedia.org/wiki/TGA_(formato_di_file)  Targa]. 

= Supportato dal formato =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% | Tipo di Targa
! width=10% | Darkplaces
! width=10% | NetRadiant
|-
| scala di grigi a 8 bit
| +
| -
|-
| palette a 8 bit
| +
| - 
|-
| 16 bit
| +
| - 
|-
| 24 bit
| +
| +
|-
| 32 bit
| +
| +
|-
| RLE a 24 bit
| +
| -
|-
| RLE a 32 bit
| +
| -
|}



[[Category:InItalian/Formati_dei_file]]
{{initalian|TGA}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
    <revision>
      <id>3622</id>
      <timestamp>2013-03-23T18:29:27Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="628">Questa estensione fa riferimento al formato di immagine [http://it.wikipedia.org/wiki/TGA_(formato_di_file)  Targa]. 

= Supportato dal formato =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% | Tipo di Targa
! width=10% | Darkplaces
! width=10% | NetRadiant
|-
| scala di grigi a 8 bit
| +
| -
|-
| palette a 8 bit
| +
| - 
|-
| 16 bit
| +
| - 
|-
| 24 bit
| +
| +
|-
| 32 bit
| +
| +
|-
| RLE a 24 bit
| +
| -
|-
| RLE a 32 bit
| +
| -
|}



[[Category:InItalian/Formati_dei_file]]
[[Category:InItalian/Motore_grafico_DarkPlaces]]
{{initalian|TGA}}
__NOEDITSECTION__
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Terrore spinato</title>
    <ns>0</ns>
    <id>632</id>
      <sha1>l89i2zx42keylhim6t8i4b2b8brqloo</sha1>
    <revision>
      <id>3530</id>
      <timestamp>2013-01-24T16:34:22Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden2|bo_enemy_pulsemonster.gif|Terrore spinato}} Un umanoide creato artificialmente (o forse un tempo umano) che vaga sul suolo del Dark Eden. Il suo aspetto è mol...&quot;</comment>
      <text xml:space="preserve" bytes="786">{{BoEnemy|eden2|bo_enemy_pulsemonster.gif|Terrore spinato}}
Un umanoide creato artificialmente (o forse un tempo umano) che vaga sul suolo del Dark Eden. Il suo aspetto è molto consumato, com braccia e gambe sottili e una testa completamente priva di peli. La schiena è completamente costellata di lunghe e affilate ossa simili ad aghi che sembrano uscirgli dal corpo. Attacca a distanza: si avvicina al bersaglio e poi getta 8 spine a 360 gradi.

===Statistiche===
:Salute: 20
:Danno: 15 (ogni spina)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_pulsemonster]]

==Concept art==
&lt;gallery&gt;
File:BO-Concept-Art-MutantConcept2.JPG
&lt;/gallery&gt;

{{initalian|Terrore spinato}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3531</id>
      <timestamp>2013-01-24T16:34:44Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="787">{{BoEnemy|eden2|bo_enemy_pulsemonster.gif|Terrore spinato}}
Un umanoide creato artificialmente (o forse un tempo umano) che vaga sul suolo del Dark Eden. Il suo aspetto è molto consumato, com braccia e gambe sottili e una testa completamente priva di peli. La schiena è completamente costellata di lunghe e affilate ossa simili ad aghi che sembrano uscirgli dal corpo. Attacca a distanza: si avvicina al bersaglio e poi lancia 8 spine a 360 gradi.

===Statistiche===
:Salute: 20
:Danno: 15 (ogni spina)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_pulsemonster]]

==Concept art==
&lt;gallery&gt;
File:BO-Concept-Art-MutantConcept2.JPG
&lt;/gallery&gt;

{{initalian|Terrore spinato}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3547</id>
      <timestamp>2013-01-24T18:21:26Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="740">{{NemiciBO|eden2|bo_enemy_pulsemonster.gif|Terrore spinato}}
Un umanoide creato artificialmente (o forse un tempo umano) che vaga sul suolo del Dark Eden. Il suo aspetto è molto consumato, com braccia e gambe sottili e una testa completamente priva di peli. La schiena è completamente costellata di lunghe e affilate ossa simili ad aghi che sembrano uscirgli dal corpo. Attacca a distanza: si avvicina al bersaglio e poi lancia 8 spine a 360 gradi.

===Statistiche===
:Salute: 20
:Danno: 15 (ogni spina)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_pulsemonster]]

==Concept art==
&lt;gallery&gt;
File:BO-Concept-Art-MutantConcept2.JPG
&lt;/gallery&gt;

{{initalian|Terrore spinato}}
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3552</id>
      <timestamp>2013-01-26T13:30:38Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="727">{{NemiciBO|eden2|bo_enemy_pulsemonster.gif|Terrore spinato}}
Un umanoide creato artificialmente (o forse un tempo umano) che vaga sul suolo del Dark Eden. Il suo aspetto è molto consumato, con braccia e gambe sottili ed una testa priva di peli. La schiena è completamente costellata di lunghe e affilate ossa simili ad aghi che sembrano uscirgli dal corpo. Attacca a distanza: si avvicina al bersaglio e poi lancia 8 spine a 360 gradi.

===Statistiche===
:Salute: 20
:Danno: 15 (ogni spina)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_pulsemonster]]

==Concept art==
&lt;gallery&gt;
File:BO-Concept-Art-MutantConcept2.JPG
&lt;/gallery&gt;

{{initalian|Terrore spinato}}
__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler</title>
    <ns>0</ns>
    <id>637</id>
      <sha1>p6uiaa01x4hcoblspr9aoaeopdm8ilp</sha1>
    <revision>
      <id>3555</id>
      <timestamp>2013-01-26T20:33:04Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Tutorial: Modificare il percorso per le skin con MD3 Compiler di Npherno}} {{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}} {{TOCRIGHT}}  ==Cosa ...&quot;</comment>
      <text xml:space="preserve" bytes="3415">{{DISPLAYTITLE:Tutorial: Modificare il percorso per le skin con MD3 Compiler di Npherno}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{TOCRIGHT}}

==Cosa serve==
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler di Npherno]]
* Un modello MD3

==Di cosa si parla?==
Questo tutorial vi permetterà di imparare ad utilizzare un tool utile ed essenziale, MD3 Compiler, che serve a modificare i modelli MD3. Più nello specifico, questo tutorial vi farà vedere come scegliere o cambiare il materiale ad una superficie.

I [[Darkplaces material system|nomi dei materiali]] sono contenuti negli MD3 stessi. Quando il gioco carica un modello usa il nome incorporato per caricare il materiale o la texture giusto.

Modificare gli MD3 può essere problematico le prime volte, ma è molto facile e non richiede mai più di un minuto e mezzo.

==Passo 1: Importare gli oggetti==
Lanciate MD3 Compiler. Si fa dal file &quot;MD3Compile.exe&quot;.
Questo è quello che vedrete:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Ora fate click sul bottone &quot;Import objects&quot;, e selezionate l'MD3 che volete modificare.
Apparirà questa finestra:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Selezionate tutte le parti del modello e fate click su &quot;OK&quot;.
Adesso dovrebbe apparire il modello al centro sotto forma di un insieme di oggetti rossi e blu.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

La finestra dovrebbe essere simile all'immagine 3.
{{importante|Ora fate click sul bottone &quot;All&quot; (subito sopra a &quot;Import objects&quot;). Assicuratevi che la casella dell'immagine 4 sia segnata prima di andare avanti!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Passo 2: Modificare il materiale==
Ora possiamo cambiare il materiale di un qualsiasi oggetto importato.
Di solito negli MD3 si trova un unico oggetto. Se avete selezionato più di un oggetto nella finestra di importazione (immagine 2) potrebbero esserci degli oggetti il cui percorso va modificato.

Usate la finestra a cascata per scegliere un oggetto (in questo caso abbiamo visto che è stato scelto &quot;w_nailgun&quot;). Il percorso incorporato per la skin apparirà nel campo di testo subito sotto. Ora potete modificare il percorso. 
{{importante|Ricordatevi di usare sempre barre e mai barre rovesciate nei percorsi. Non importa cosa appare nel percorso originale, usate barre ndel tipo &quot;/&quot;. Non farlo significa non vedere la texture durante il gioco.}}
{{consiglio|Se il nome del materiale che inserite è vuoto o è una riga non valida (come ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') esso non verrà disegnato}}

==Passo 3: Ultimo passo==
Dopo aver modificato i percorsi di tutti gli oggetti bisogna esportare il modello, così da salvare tutte le modifiche.
Fate click su &quot;Export objects&quot; e date un nome appropriato all'MD3. Potete anche benissimo sovrascrivere l'MD3 che avete importato.

Apparirà una finestra per chiedervi un &quot;Internal name&quot;. A meno che non stiate modificando un modello per il giocatore ignoratela e lasciatela vuota.
Fate solo click su &quot;OK&quot;.

==Riepilogo==
Riepilogando questo tutorial, ecco i passi fondamentali:
# Importate gli oggetti
# Modificate il nome (ricordatevi del tipo di BARRE)
# Esportate gli oggetti

==Vedi anche==
* [[Darkplaces material system]]
* [[Texture]]


{{initalian|Tutorial: Modificare il percorso per le skin con MD3 Compiler di Npherno}}
[[Category:Tutorial]]
{{finished}}</text>
    </revision>
    <revision>
      <id>3570</id>
      <timestamp>2013-01-31T14:53:22Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <minor/>
      <comment>Makenor13 moved page [[Tutorial: Modificare il percorso per le skin con MD3 Compiler]] to [[Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler]]: It's an italian page</comment>
      <text xml:space="preserve" bytes="3415">{{DISPLAYTITLE:Tutorial: Modificare il percorso per le skin con MD3 Compiler di Npherno}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{TOCRIGHT}}

==Cosa serve==
* [[Portal:InItalian/MD3 Compiler | MD3 Compiler di Npherno]]
* Un modello MD3

==Di cosa si parla?==
Questo tutorial vi permetterà di imparare ad utilizzare un tool utile ed essenziale, MD3 Compiler, che serve a modificare i modelli MD3. Più nello specifico, questo tutorial vi farà vedere come scegliere o cambiare il materiale ad una superficie.

I [[Darkplaces material system|nomi dei materiali]] sono contenuti negli MD3 stessi. Quando il gioco carica un modello usa il nome incorporato per caricare il materiale o la texture giusto.

Modificare gli MD3 può essere problematico le prime volte, ma è molto facile e non richiede mai più di un minuto e mezzo.

==Passo 1: Importare gli oggetti==
Lanciate MD3 Compiler. Si fa dal file &quot;MD3Compile.exe&quot;.
Questo è quello che vedrete:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Ora fate click sul bottone &quot;Import objects&quot;, e selezionate l'MD3 che volete modificare.
Apparirà questa finestra:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Selezionate tutte le parti del modello e fate click su &quot;OK&quot;.
Adesso dovrebbe apparire il modello al centro sotto forma di un insieme di oggetti rossi e blu.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

La finestra dovrebbe essere simile all'immagine 3.
{{importante|Ora fate click sul bottone &quot;All&quot; (subito sopra a &quot;Import objects&quot;). Assicuratevi che la casella dell'immagine 4 sia segnata prima di andare avanti!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Passo 2: Modificare il materiale==
Ora possiamo cambiare il materiale di un qualsiasi oggetto importato.
Di solito negli MD3 si trova un unico oggetto. Se avete selezionato più di un oggetto nella finestra di importazione (immagine 2) potrebbero esserci degli oggetti il cui percorso va modificato.

Usate la finestra a cascata per scegliere un oggetto (in questo caso abbiamo visto che è stato scelto &quot;w_nailgun&quot;). Il percorso incorporato per la skin apparirà nel campo di testo subito sotto. Ora potete modificare il percorso. 
{{importante|Ricordatevi di usare sempre barre e mai barre rovesciate nei percorsi. Non importa cosa appare nel percorso originale, usate barre ndel tipo &quot;/&quot;. Non farlo significa non vedere la texture durante il gioco.}}
{{consiglio|Se il nome del materiale che inserite è vuoto o è una riga non valida (come ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') esso non verrà disegnato}}

==Passo 3: Ultimo passo==
Dopo aver modificato i percorsi di tutti gli oggetti bisogna esportare il modello, così da salvare tutte le modifiche.
Fate click su &quot;Export objects&quot; e date un nome appropriato all'MD3. Potete anche benissimo sovrascrivere l'MD3 che avete importato.

Apparirà una finestra per chiedervi un &quot;Internal name&quot;. A meno che non stiate modificando un modello per il giocatore ignoratela e lasciatela vuota.
Fate solo click su &quot;OK&quot;.

==Riepilogo==
Riepilogando questo tutorial, ecco i passi fondamentali:
# Importate gli oggetti
# Modificate il nome (ricordatevi del tipo di BARRE)
# Esportate gli oggetti

==Vedi anche==
* [[Darkplaces material system]]
* [[Texture]]


{{initalian|Tutorial: Modificare il percorso per le skin con MD3 Compiler di Npherno}}
[[Category:Tutorial]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Uomo lumaca</title>
    <ns>0</ns>
    <id>631</id>
      <sha1>jp0g81ekiiq3ay3axuc3kr87jd7q0rp</sha1>
    <revision>
      <id>3529</id>
      <timestamp>2013-01-24T16:19:29Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden|bo_enemy_manslug.gif|Manslug}} Un mutante semiumano del Dark Eden, massiccio e impacciato ma estremamente pericoloso per via dei suoi attacchi velenosi.  ===Sta...&quot;</comment>
      <text xml:space="preserve" bytes="480">{{BoEnemy|eden|bo_enemy_manslug.gif|Manslug}}
Un mutante semiumano del Dark Eden, massiccio e impacciato ma estremamente pericoloso per via dei suoi attacchi velenosi.

===Statistiche===
:Salute: 40
:Danno: 15 (velenoso)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_manslug]]

==Concept art==
&lt;gallery&gt;
File:Amddred manslug.png
&lt;/gallery&gt;

{{initalian|Uomo lumaca}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3535</id>
      <timestamp>2013-01-24T17:54:39Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="484">{{BoEnemy|eden|bo_enemy_manslug.gif|Uomo lumaca}}
Un mutante semiumano del Dark Eden, massiccio e impacciato ma estremamente pericoloso per via dei suoi attacchi velenosi.

===Statistiche===
:Salute: 40
:Danno: 15 (velenoso)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_manslug]]

==Concept art==
&lt;gallery&gt;
File:Amddred manslug.png
&lt;/gallery&gt;

{{initalian|Uomo lumaca}}
[[Category:InItalian/Personaggi_di_Blood_Omen]]
__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3548</id>
      <timestamp>2013-01-24T18:21:36Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="437">{{NemiciBO|eden|bo_enemy_manslug.gif|Uomo lumaca}}
Un mutante semiumano del Dark Eden, massiccio e impacciato ma estremamente pericoloso per via dei suoi attacchi velenosi.

===Statistiche===
:Salute: 40
:Danno: 15 (velenoso)
:Sangue: verde
:Velocità di movimento: media
:Tipo di personaggio: animale
:Entity: [[animal_manslug]]

==Concept art==
&lt;gallery&gt;
File:Amddred manslug.png
&lt;/gallery&gt;

{{initalian|Uomo lumaca}}
__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Portal:InItalian/Virtual file system di DarkPlaces</title>
    <ns>0</ns>
    <id>652</id>
      <sha1>73wgggfhwqiviiqm49zjs9wolr1453o</sha1>
    <revision>
      <id>3625</id>
      <timestamp>2013-03-23T20:32:50Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Created page with &quot;{{TOCRIGHT}} Il virtual file system di DarkPlaces è una tabella di file di sostituzione che combina il vero file system e i file contenuti in archivi di gioco [[Portal:InItal...&quot;</comment>
      <text xml:space="preserve" bytes="2796">{{TOCRIGHT}}
Il virtual file system di DarkPlaces è una tabella di file di sostituzione che combina il vero file system e i file contenuti in archivi di gioco [[Portal:InItalian/PK3|PK3]] e [[Portal:InItalian/PAK|PAK]].

Le cose che permette di fare:

* accesso trasparente a game directory separate contenenti file tutti scrivibili (My Documents/My Games)
* accesso a file dentro ad archivi come se fossero sull'HDD
* supporto per mod (le mod possono sostituire file ed aggiungerne di nuovi)
* sicurezza (il codice di gioco non può danneggiare i file di gioco)

== Come è fatta la tabella di file ==

# La prima game directory viene processata
## Gli archivi sono processati in sequenza (per ordine alfabetico), i dile con lo stesso nome vengono sovrapposti
## I file vuoti sovrapposti ad altri vengono &quot;cancellati&quot; dal file system
## I file reali contenuti nella game directory vengono processati e sovrapposti ai file negli archivi
# La successiva game directory viene processata

== Peculiarità ==

Dato che il virtual file system è, in fin dei conti, un livello astratto, ha delle proprie peculiarità.

====1. La home directory può essere diversa dalla game directory====

Questo significa che il config.cfg, gli screenshot eccetera sono contenunti in una cartella diversa, ad esempio in &quot;My Documents/My Games/gamedir&quot;

====2. Per i file scritti &quot;data/&quot; viene aggiunto automaticamente====

Quando QC scrive un qualsiasi file il motore aggiunge in automatico 'data/' al percorso, così che il codice di gioco non possa danneggiare file, mappe... Ma il processo di lettura è diverso. Può leggere file dalla cartella di base, delle open map...

Così, se si scrive, ad esempio, un &quot;foo.txt&quot; (che verrà scritto in &quot;data/foo.txt&quot;) e si ha un &quot;foo.txt&quot; nella game directory, diventa necessario indicare il percorso &quot;data/foo.txt&quot; quando si legge il file, e indicare &quot;foo.txt&quot; quando si scrive. Se non lo si fa, il file verrà scritto sotto &quot;data/&quot;, ma verrà letto il file nella game directory.

====3. &quot;./&quot; e &quot;../&quot; non sono utilizzabili====

Per prevenire che il codice di gioco danneggi dei file l'uso degli operatori &quot;.&quot; e &quot;..&quot; per i percorsi sono proibiti.

====4. Non completamente integrato nell'editor di mappe====

L'editor di mappe non supporta il virtual file system nella finestra di selezione modelli (l'ispettore delle entity), può selezionare solo file reali. Questo non è un problema per la versione di sviluppo di Blood Omnicide (copia in locale di SVN con installazioni di prova), ma la versione che sarà diffusa dell'SDK dovrà per forza avere tutti i modelli di gioco decompressi, in modo di farli vedere dall'editor nella finestra di selezione modelli.

[[Category:InItalian/Motore grafico DarkPlaces]]
{{finished}}
{{initalian|Virtual file system di DarkPlaces}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InRussian</title>
    <ns>0</ns>
    <id>305</id>
      <sha1>q349jsd9x5lbj97jrv89hf6tyj5inmo</sha1>
    <revision>
      <id>2865</id>
      <timestamp>2012-11-22T12:34:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;= Blood Wiki по-русски = Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публ...&quot;</comment>
      <text xml:space="preserve" bytes="534">= Blood Wiki по-русски =
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы некоторых статей на великий и могучий.

== Руководства ==
* [[Portal:Russian/Кодекс Blood Omnicide|Кодекс проекта Blood Omnicide]]
* [[Portal:Russian/Ликбез по моделированию|Ликбез по моделированию]]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2866</id>
      <timestamp>2012-11-22T12:36:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="547">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы некоторых статей на великий и могучий.

== Руководства ==
* [[Portal:Russian/Кодекс Blood Omnicide|Кодекс проекта Blood Omnicide]]
* [[Portal:Russian/Ликбез по моделированию|Ликбез по моделированию]]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2867</id>
      <timestamp>2012-11-22T12:38:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Portal:Russian]] to [[Portal:InRussian]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="547">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы некоторых статей на великий и могучий.

== Руководства ==
* [[Portal:Russian/Кодекс Blood Omnicide|Кодекс проекта Blood Omnicide]]
* [[Portal:Russian/Ликбез по моделированию|Ликбез по моделированию]]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2870</id>
      <timestamp>2012-11-22T12:43:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="582">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы некоторых статей на великий и могучий.

== Руководства ==
* [[Portal:Russian/Кодекс разработчика Blood Omnicide|Кодекс разработчика Blood Omnicide]]
* [[Portal:Russian/Ликбез по моделированию|Ликбез по моделированию]]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2873</id>
      <timestamp>2012-11-22T12:54:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="586">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы некоторых статей на великий и могучий.

== Руководства ==
* [[Portal:InRussian/Кодекс разработчика Blood Omnicide|Кодекс разработчика Blood Omnicide]]
* [[Portal:InRussian/Ликбез по моделированию|Ликбез по моделированию]]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2885</id>
      <timestamp>2012-11-22T13:21:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="664">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы некоторых статей на великий и могучий.

== Руководства ==
* [[Portal:InRussian/Кодекс разработчика Blood Omnicide|Кодекс разработчика Blood Omnicide]]
* [[Portal:InRussian/Ликбез по моделированию|Ликбез по моделированию]]

== Инструменты ==
* [http://omnicide.legacy-of-kain.ru/todo ToDo]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>2886</id>
      <timestamp>2012-11-22T13:25:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="676">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы небольшой части статей на великий и могучий. 

== Руководства ==
* [[Portal:InRussian/Кодекс разработчика Blood Omnicide|Кодекс разработчика Blood Omnicide]]
* [[Portal:InRussian/Ликбез по моделированию|Ликбез по моделированию]]

== Инструменты ==
* [http://omnicide.legacy-of-kain.ru/todo ToDo]

__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3636</id>
      <timestamp>2013-04-17T14:15:58Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="745">{{DISPLAYTITLE:Blood Wiki по-русски}}
Добро пожаловать в русскоязычный портал [[Main Page|Blood Wiki]]. На данном портале публикуются переводы небольшой части статей на великий и могучий. 

== Руководства ==
* [[Portal:InRussian/Кодекс разработчика Blood Omnicide|Кодекс разработчика Blood Omnicide]]
* [[Portal:InRussian/Ликбез по моделированию|Ликбез по моделированию]]

== Инструменты ==
* [http://omnicide.legacy-of-kain.ru/todo ToDo]

== Концепты ==
* [[Portal:InRussian/Арена|Арена]]

__NOTOC__
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InRussian/Арена</title>
    <ns>0</ns>
    <id>655</id>
      <sha1>iodjcdql7t6lpitp3jqvcffqvw7jzn8</sha1>
    <revision>
      <id>3637</id>
      <timestamp>2013-04-17T15:08:24Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <comment>Created page with &quot;=Предназначение=  Этот режим будет преследовать несколько целей: * 'Тестовый стенд': это позволит...&quot;</comment>
      <text xml:space="preserve" bytes="758">=Предназначение= 
Этот режим будет преследовать несколько целей:
* 'Тестовый стенд': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* 'Массакр': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* 'Мультиплеер': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;</text>
    </revision>
    <revision>
      <id>3638</id>
      <timestamp>2013-04-17T15:47:24Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <comment>/* Предназначение */</comment>
      <text xml:space="preserve" bytes="3392">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.</text>
    </revision>
    <revision>
      <id>3639</id>
      <timestamp>2013-04-17T17:30:31Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <text xml:space="preserve" bytes="5262">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.

= Меню =
Для описываемых фич требуются новые интерфейсные экраны, среди которых должны быть ''создание новой игры, настройка инвентаря, поиск игры в интернете, подключение к созданной игре''.

== Новая игра ==
* Выбор режима;
* Выбор карты;
* Продвинутое редактирование:
** Количество игроков в игре;
** Подключение новых игроков:
*** Вход в игру по подключению;
*** Вход в игру по новой сессии;
** Выбор времени суток:
*** Динамика;
*** Статика:
**** День;
**** Ночь;
**** Сумерки;
** Количество возрождений:
*** Индивидуальное количество;
*** Групповое количество;
** Количество артефактов (кроме Сердец Тьмы);
** Разрешение оружия;
** Разрешение брони;
** Разрешение заклинаний;
** Количество заклинаний на игрока;
* Выход на экран выбора игрока;

В эту схему нужно вместить установки команд, установка фракций, установка даются ли оружие, броня, артефакты, заклинания изначально либо их нужно собирать.

Также должна быть возможность сохранения настроек в отдельный конфигурационный файл, чтобы не нужно было перенастраивать игру с дефолта каждый новый раз.</text>
    </revision>
    <revision>
      <id>3640</id>
      <timestamp>2013-04-17T17:38:37Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <minor/>
      <comment>/* Новая игра */</comment>
      <text xml:space="preserve" bytes="5364">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.

= Меню =
Для описываемых фич требуются новые интерфейсные экраны, среди которых должны быть ''создание новой игры, настройка инвентаря, поиск игры в интернете, подключение к созданной игре''.

== Новая игра ==
* '''Выбор режима''';
* '''Выбор карты''';
* '''Продвинутое редактирование''':
** Количество игроков в игре;
** Подключение новых игроков:
*** ''Вход в игру по подключению'';
*** ''Вход в игру по новой сессии'';
** Выбор времени суток:
*** ''Динамика'';
*** ''Статика'':
**** ''День'';
**** ''Ночь'';
**** ''Сумерки'';
** Количество возрождений:
*** ''Индивидуальное количество'';
*** ''Групповое количество'';
** Количество артефактов (кроме Сердец Тьмы);
** Разрешение оружия;
** Разрешение брони;
** Разрешение заклинаний;
** Количество заклинаний на игрока;
* '''Выход на экран выбора игрока''';

В эту схему нужно вместить установки команд, установка фракций, установка даются ли оружие, броня, артефакты, заклинания изначально либо их нужно собирать, установка на респаун...

Также должна быть возможность сохранения настроек в отдельный конфигурационный файл, чтобы не нужно было перенастраивать игру с дефолта каждый новый раз.</text>
    </revision>
    <revision>
      <id>3641</id>
      <timestamp>2013-04-17T17:47:03Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <comment>/* Меню */</comment>
      <text xml:space="preserve" bytes="5938">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.

= Меню =
Для описываемых фич требуются новые интерфейсные экраны, среди которых должны быть ''создание новой игры, настройка инвентаря, поиск игры в интернете, подключение к созданной игре''.

== Новая игра ==
'''New Game'''

* '''Выбор режима''';
* '''Выбор карты''';
* '''Продвинутое редактирование''':
** Количество игроков в игре;
** Подключение новых игроков:
*** ''Вход в игру по подключению'';
*** ''Вход в игру по новой сессии'';
** Выбор времени суток:
*** ''Динамика'';
*** ''Статика'':
**** ''День'';
**** ''Ночь'';
**** ''Сумерки'';
** Количество возрождений:
*** ''Индивидуальное количество'';
*** ''Групповое количество'';
** Количество артефактов (кроме Сердец Тьмы);
** Разрешение оружия;
** Разрешение брони;
** Разрешение заклинаний;
** Количество заклинаний на игрока;
* '''Выход на экран &quot;Настройка игрока&quot;''';

В эту схему нужно вместить установки команд, установка фракций, установка даются ли оружие, броня, артефакты, заклинания изначально либо их нужно собирать, установка на респаун...

Также должна быть возможность сохранения настроек в отдельный конфигурационный файл, чтобы не нужно было перенастраивать игру с дефолта каждый новый раз.

== Поиск игры ==
'''Find Games'''

* Тип связи:
** Интернет:
** Публичные сервера;
** Определённый адрес;
** ЛАН;
* Фильтры поиска:
** Полные
** Пустые
** Режим игры;
** Пароль;
** Модификация;
* '''Выход на экран &quot;Присоединиться к игре&quot;''';

== Присоединиться к игре ==
* Выбор команды/фракции;
* Чат;
* '''Выход на экран выбора игрока''';</text>
    </revision>
    <revision>
      <id>3642</id>
      <timestamp>2013-04-17T18:10:46Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <text xml:space="preserve" bytes="6489">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.

= Меню =
Для описываемых фич требуются новые интерфейсные экраны, среди которых должны быть ''создание новой игры, настройка инвентаря, поиск игры в интернете, подключение к созданной игре''.

== Новая игра ==
'''New Game'''

* '''Выбор режима''';
* '''Выбор карты''';
* '''Продвинутое редактирование''':
** Количество игроков в игре;
** Подключение новых игроков:
*** ''Вход в игру по подключению'';
*** ''Вход в игру по новой сессии'';
** Выбор времени суток:
*** ''Динамика'';
*** ''Статика'':
**** ''День'';
**** ''Ночь'';
**** ''Сумерки'';
** Количество возрождений:
*** ''Индивидуальное количество'';
*** ''Групповое количество'';
** Количество артефактов (кроме Сердец Тьмы);
** Разрешение оружия;
** Разрешение брони;
** Разрешение заклинаний;
** Количество заклинаний на игрока;
* '''Выход на экран &quot;Настройка игрока&quot;''';

В эту схему нужно вместить установки команд, установка фракций, установка даются ли оружие, броня, артефакты, заклинания изначально либо их нужно собирать, установка на респаун...

Также должна быть возможность сохранения настроек в отдельный конфигурационный файл, чтобы не нужно было перенастраивать игру с дефолта каждый новый раз.

== Поиск игры ==
'''Find Games'''

* '''Тип связи''':
** Интернет:
** Публичные сервера;
** Определённый адрес;
** ЛАН;
* '''Фильтры поиска''':
** Полные;
** Пустые;
** Режим игры;
** Пароль;
** Модификации;
* '''Выход на экран &quot;Присоединиться к игре&quot;''';

== Присоединиться к игре ==
'''Join Game'''

* '''Выбор команды/фракции''';
* '''Чат''';
* '''Выход на экран выбора игрока''';

== Настройка игрока ==
'''Player Setup'''

* Выбор имени;
* Выбор модельки (или спрайта):
** Выбор головы (для модели);
* Выбор цвета:
** Основной;
** Дополнительный;
* Выбор предпочитаемых заклинаний;
* Выбор предпочитаемых артефактов;
* Выбор предпочитаемой брони;
* Выбор предпочитаемого оружия;</text>
    </revision>
    <revision>
      <id>3643</id>
      <timestamp>2013-04-17T18:13:39Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="6615">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.

= Меню =
Для описываемых фич требуются новые интерфейсные экраны, среди которых должны быть ''создание новой игры, настройка инвентаря, поиск игры в интернете, подключение к созданной игре''.

== Новая игра ==
'''New Game'''

* '''Выбор режима''';
* '''Выбор карты''';
* '''Продвинутое редактирование''':
** Количество игроков в игре;
** Подключение новых игроков:
*** ''Вход в игру по подключению'';
*** ''Вход в игру по новой сессии'';
** Выбор времени суток:
*** ''Динамика'';
*** ''Статика'':
**** ''День'';
**** ''Ночь'';
**** ''Сумерки'';
** Количество возрождений:
*** ''Индивидуальное количество'';
*** ''Групповое количество'';
** Количество артефактов (кроме Сердец Тьмы);
** Разрешение оружия;
** Разрешение брони;
** Разрешение заклинаний;
** Количество заклинаний на игрока;
* '''Выход на экран &quot;Настройка игрока&quot;''';

В эту схему нужно вместить установки команд, установка фракций, установка даются ли оружие, броня, артефакты, заклинания изначально либо их нужно собирать, установка на респаун...

Также должна быть возможность сохранения настроек в отдельный конфигурационный файл, чтобы не нужно было перенастраивать игру с дефолта каждый новый раз.

== Поиск игры ==
'''Find Games'''

* '''Тип связи''':
** Интернет:
** Публичные сервера;
** Определённый адрес;
** ЛАН;
* '''Фильтры поиска''':
** Полные;
** Пустые;
** Режим игры;
** Пароль;
** Модификации;
* '''Выход на экран &quot;Присоединиться к игре&quot;''';

== Присоединиться к игре ==
'''Join Game'''

* '''Выбор команды/фракции''';
* '''Чат''';
* '''Выход на экран выбора игрока''';

== Настройка игрока ==
'''Player Setup'''

* Выбор имени;
* Выбор модельки (или спрайта):
** Выбор головы (для модели);
* Выбор цвета:
** Основной;
** Дополнительный;
* Выбор предпочитаемых заклинаний;
* Выбор предпочитаемых артефактов;
* Выбор предпочитаемой брони;
* Выбор предпочитаемого оружия;

= Ссылки ==
* https://docs.google.com/document/d/1Fo8mPy7aEu_Wtmng7Oq1q0xNKKxD08jgBxG9zHuoL1Y
{{inrussian|Арена}}</text>
    </revision>
    <revision>
      <id>3644</id>
      <timestamp>2013-04-17T18:17:07Z</timestamp>
      <contributor>
        <username>AmDDRed</username>
        <id>9</id>
      </contributor>
      <minor/>
      <comment>/* Новая игра */</comment>
      <text xml:space="preserve" bytes="6664">= Предназначение = 
Этот режим будет преследовать несколько целей:
* '''Тестовый стенд''': это позволит тестировать новые фичи игры на специально созданных картах, упрощая исследование фич и багов;
* '''Массакр''': времяубийство в стиле «Crimsonland» или чего-нибудь ещё;
* '''Мультиплеер''': фактически, это будет единственная возможность поиграть в 'Blood Omnicide' с другим человеком. Также, это откроет большой простор для идей и модификаций;

= Режимы игры =
Для реализации предлагаются несколько режимов:
# '''Adventure''': режим, в котором игрок может проходить кастомные кампании, созданные на стороне. По геймплею не должны существенно отличаться от оригинальной кампании. Могут быть рассчитанными как на одного игрока, так и на многих;
# '''Survival''': режим, в котором игроку (или игрокам) нужно отбиваться от волн нападающих врагов;
# '''Defend''': режим, в котором игроку нужно не допустить уничтожения волнами врагов чего-либо; к примеру, 9 Хранителей, Сердце Подземелья (чтобы это не значило), короля итд;
# '''Duel''': режим, в котором игрок сражается с единственным, себеподобным, врагом;
# '''Deathmatch''': режим, в котором игроки бьют друг друга;
# '''Team Deathmatch''': режим, в котором игроки бьют друг друга сообща;
# '''Faction Deathmatch''': режим, в котором игроки делятся на команды по принципу фракций
# '''Hunt''': режим, в котором вампиры охотятся на охотников на вампиров. Посколько требует много усилий для баланса, дополнительных заклинаний/артефактов, то вряд ли скорореализуемо.
# '''Vampire Tag''': режим, в котором один игрок является Каином, он набирает очки; тот, кто его убьёт станет Каином;

И прочие сценарии, в которых сложность скриптов отдельно взятой карты будет варьироваться от мала до велика.&lt;br/&gt;
Возможно, для лучшего сочетания с игровой вселенной, надо как-то переназвать режимы а-ля “Vae Victus” (duel), “Moebius Game” (survival) и так далее.&lt;br/&gt;
Также, хорошими идеями для режимов/карт могут стать какие-то ключевые эпизоды кампании.

= Меню =
Для описываемых фич требуются новые интерфейсные экраны, среди которых должны быть ''создание новой игры, настройка инвентаря, поиск игры в интернете, подключение к созданной игре''.

== Новая игра ==
'''New Game'''

* '''Выбор режима''';
* '''Выбор карты''';
* '''Продвинутое редактирование''':
** Количество игроков в игре;
** Подключение новых игроков:
*** ''Вход в игру по подключению'';
*** ''Вход в игру по новой сессии'';
** Выбор времени суток:
*** ''Динамика'':
**** ''Скорость смены суток'';
*** ''Статика'':
**** ''День'';
**** ''Ночь'';
**** ''Сумерки'';
** Количество возрождений:
*** ''Индивидуальное количество'';
*** ''Групповое количество'';
** Количество артефактов (кроме Сердец Тьмы);
** Разрешение оружия;
** Разрешение брони;
** Разрешение заклинаний;
** Количество заклинаний на игрока;
* '''Выход на экран &quot;Настройка игрока&quot;''';

В эту схему нужно вместить установки команд, установка фракций, установка даются ли оружие, броня, артефакты, заклинания изначально либо их нужно собирать, установка на респаун...

Также должна быть возможность сохранения настроек в отдельный конфигурационный файл, чтобы не нужно было перенастраивать игру с дефолта каждый новый раз.

== Поиск игры ==
'''Find Games'''

* '''Тип связи''':
** Интернет:
** Публичные сервера;
** Определённый адрес;
** ЛАН;
* '''Фильтры поиска''':
** Полные;
** Пустые;
** Режим игры;
** Пароль;
** Модификации;
* '''Выход на экран &quot;Присоединиться к игре&quot;''';

== Присоединиться к игре ==
'''Join Game'''

* '''Выбор команды/фракции''';
* '''Чат''';
* '''Выход на экран выбора игрока''';

== Настройка игрока ==
'''Player Setup'''

* Выбор имени;
* Выбор модельки (или спрайта):
** Выбор головы (для модели);
* Выбор цвета:
** Основной;
** Дополнительный;
* Выбор предпочитаемых заклинаний;
* Выбор предпочитаемых артефактов;
* Выбор предпочитаемой брони;
* Выбор предпочитаемого оружия;

= Ссылки ==
* https://docs.google.com/document/d/1Fo8mPy7aEu_Wtmng7Oq1q0xNKKxD08jgBxG9zHuoL1Y
{{inrussian|Арена}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InRussian/Кодекс разработчика Blood Omnicide</title>
    <ns>0</ns>
    <id>306</id>
      <sha1>gf2b6apf8y8el3plva6v0d1mztbxtus</sha1>
    <revision>
      <id>2871</id>
      <timestamp>2012-11-22T12:49:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{finished}} # Blood Omnicide это проект переноса Blood Omen в 3D. Минимум отсебятины, максимум оригинала. Другими ...&quot;</comment>
      <text xml:space="preserve" bytes="3049">{{finished}}
# Blood Omnicide это проект переноса Blood Omen в 3D. Минимум отсебятины, максимум оригинала. Другими словами: если что-то не сломано - не надо это чинить. Добавление собственных деталей уместно в том случае, если необходимо заполнять пробелы, отсутствующие в оригинале.
# В Blood Omen повсюду присутствует штамп разложения колонн. Образ мира на пороге смерти. Этой мыслью нужно руководствоваться при создании моделей и текстур. Также авторы текстур/спрайтов BO очень часто используют скрытые символы. Например частое использование кричащих лиц и черепов, или узоры некоторых решеток - они могут напоминать пауков и змей. Деревья в Blood Omen больные, с хилой листвой и оголенными ветками. В общем, постарайтесь передавать скрытый сигнал объектов - это суть атмосферы BO.
# Не используй 'рипнутый' из других игр контент.
# Всегда нужно концентрироваться на самых слабых местах, и подтягивать их в первую очередь.
# Продолжай улучшать, даже если остались самые крохотные детали.
# Документируй изменения. Заполняй логи коммитов.
# Следуй заранее установленному плану.
# Большие задачи старайся разбивать на маленькие чтобы не потеряться по пути.
# Всегда будь открыт для той помощи, которую могут предложить другие.
# Веди и пополняй список предложений и ошибок.
# Если не знаешь как что-то сделать - спроси других.
# Будь в курсе работы других участников, без знания прошлого не войдешь в будущее
# Если не готов видеть свои недочеты - попроси других исправить то, что сделал ты.
# Профессиональная интуиция лучше знания всего-на-свете, будь в хорошей умственной форме.
# Уважай других разработчиков и их труд.
# Критикуй, если можешь сделать лучше.
# Кодекс не абсолютен.



-----
[[Portal:InRussian|BloodWiki по-русски]]</text>
    </revision>
    <revision>
      <id>2872</id>
      <timestamp>2012-11-22T12:53:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Portal:Russian/Кодекс разработчика Blood Omnicide]] to [[Portal:InRussian/Кодекс разработчика Blood Omnicide]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="3049">{{finished}}
# Blood Omnicide это проект переноса Blood Omen в 3D. Минимум отсебятины, максимум оригинала. Другими словами: если что-то не сломано - не надо это чинить. Добавление собственных деталей уместно в том случае, если необходимо заполнять пробелы, отсутствующие в оригинале.
# В Blood Omen повсюду присутствует штамп разложения колонн. Образ мира на пороге смерти. Этой мыслью нужно руководствоваться при создании моделей и текстур. Также авторы текстур/спрайтов BO очень часто используют скрытые символы. Например частое использование кричащих лиц и черепов, или узоры некоторых решеток - они могут напоминать пауков и змей. Деревья в Blood Omen больные, с хилой листвой и оголенными ветками. В общем, постарайтесь передавать скрытый сигнал объектов - это суть атмосферы BO.
# Не используй 'рипнутый' из других игр контент.
# Всегда нужно концентрироваться на самых слабых местах, и подтягивать их в первую очередь.
# Продолжай улучшать, даже если остались самые крохотные детали.
# Документируй изменения. Заполняй логи коммитов.
# Следуй заранее установленному плану.
# Большие задачи старайся разбивать на маленькие чтобы не потеряться по пути.
# Всегда будь открыт для той помощи, которую могут предложить другие.
# Веди и пополняй список предложений и ошибок.
# Если не знаешь как что-то сделать - спроси других.
# Будь в курсе работы других участников, без знания прошлого не войдешь в будущее
# Если не готов видеть свои недочеты - попроси других исправить то, что сделал ты.
# Профессиональная интуиция лучше знания всего-на-свете, будь в хорошей умственной форме.
# Уважай других разработчиков и их труд.
# Критикуй, если можешь сделать лучше.
# Кодекс не абсолютен.



-----
[[Portal:InRussian|BloodWiki по-русски]]</text>
    </revision>
    <revision>
      <id>2876</id>
      <timestamp>2012-11-22T13:02:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3006">{{finished}}
# Blood Omnicide это проект переноса Blood Omen в 3D. Минимум отсебятины, максимум оригинала. Другими словами: если что-то не сломано - не надо это чинить. Добавление собственных деталей уместно в том случае, если необходимо заполнять пробелы, отсутствующие в оригинале.
# В Blood Omen повсюду присутствует штамп разложения колонн. Образ мира на пороге смерти. Этой мыслью нужно руководствоваться при создании моделей и текстур. Также авторы текстур/спрайтов BO очень часто используют скрытые символы. Например частое использование кричащих лиц и черепов, или узоры некоторых решеток - они могут напоминать пауков и змей. Деревья в Blood Omen больные, с хилой листвой и оголенными ветками. В общем, постарайтесь передавать скрытый сигнал объектов - это суть атмосферы BO.
# Не используй 'рипнутый' из других игр контент.
# Всегда нужно концентрироваться на самых слабых местах, и подтягивать их в первую очередь.
# Продолжай улучшать, даже если остались самые крохотные детали.
# Документируй изменения. Заполняй логи коммитов.
# Следуй заранее установленному плану.
# Большие задачи старайся разбивать на маленькие чтобы не потеряться по пути.
# Всегда будь открыт для той помощи, которую могут предложить другие.
# Веди и пополняй список предложений и ошибок.
# Если не знаешь как что-то сделать - спроси других.
# Будь в курсе работы других участников, без знания прошлого не войдешь в будущее
# Если не готов видеть свои недочеты - попроси других исправить то, что сделал ты.
# Профессиональная интуиция лучше знания всего-на-свете, будь в хорошей умственной форме.
# Уважай других разработчиков и их труд.
# Критикуй, если можешь сделать лучше.
# Кодекс не абсолютен.

{{inrussian}}</text>
    </revision>
    <revision>
      <id>2877</id>
      <timestamp>2012-11-22T13:02:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3006"># Blood Omnicide это проект переноса Blood Omen в 3D. Минимум отсебятины, максимум оригинала. Другими словами: если что-то не сломано - не надо это чинить. Добавление собственных деталей уместно в том случае, если необходимо заполнять пробелы, отсутствующие в оригинале.
# В Blood Omen повсюду присутствует штамп разложения колонн. Образ мира на пороге смерти. Этой мыслью нужно руководствоваться при создании моделей и текстур. Также авторы текстур/спрайтов BO очень часто используют скрытые символы. Например частое использование кричащих лиц и черепов, или узоры некоторых решеток - они могут напоминать пауков и змей. Деревья в Blood Omen больные, с хилой листвой и оголенными ветками. В общем, постарайтесь передавать скрытый сигнал объектов - это суть атмосферы BO.
# Не используй 'рипнутый' из других игр контент.
# Всегда нужно концентрироваться на самых слабых местах, и подтягивать их в первую очередь.
# Продолжай улучшать, даже если остались самые крохотные детали.
# Документируй изменения. Заполняй логи коммитов.
# Следуй заранее установленному плану.
# Большие задачи старайся разбивать на маленькие чтобы не потеряться по пути.
# Всегда будь открыт для той помощи, которую могут предложить другие.
# Веди и пополняй список предложений и ошибок.
# Если не знаешь как что-то сделать - спроси других.
# Будь в курсе работы других участников, без знания прошлого не войдешь в будущее
# Если не готов видеть свои недочеты - попроси других исправить то, что сделал ты.
# Профессиональная интуиция лучше знания всего-на-свете, будь в хорошей умственной форме.
# Уважай других разработчиков и их труд.
# Критикуй, если можешь сделать лучше.
# Кодекс не абсолютен.

{{inrussian}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2881</id>
      <timestamp>2012-11-22T13:05:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3059"># Blood Omnicide это проект переноса Blood Omen в 3D. Минимум отсебятины, максимум оригинала. Другими словами: если что-то не сломано - не надо это чинить. Добавление собственных деталей уместно в том случае, если необходимо заполнять пробелы, отсутствующие в оригинале.
# В Blood Omen повсюду присутствует штамп разложения колонн. Образ мира на пороге смерти. Этой мыслью нужно руководствоваться при создании моделей и текстур. Также авторы текстур/спрайтов BO очень часто используют скрытые символы. Например частое использование кричащих лиц и черепов, или узоры некоторых решеток - они могут напоминать пауков и змей. Деревья в Blood Omen больные, с хилой листвой и оголенными ветками. В общем, постарайтесь передавать скрытый сигнал объектов - это суть атмосферы BO.
# Не используй 'рипнутый' из других игр контент.
# Всегда нужно концентрироваться на самых слабых местах, и подтягивать их в первую очередь.
# Продолжай улучшать, даже если остались самые крохотные детали.
# Документируй изменения. Заполняй логи коммитов.
# Следуй заранее установленному плану.
# Большие задачи старайся разбивать на маленькие чтобы не потеряться по пути.
# Всегда будь открыт для той помощи, которую могут предложить другие.
# Веди и пополняй список предложений и ошибок.
# Если не знаешь как что-то сделать - спроси других.
# Будь в курсе работы других участников, без знания прошлого не войдешь в будущее
# Если не готов видеть свои недочеты - попроси других исправить то, что сделал ты.
# Профессиональная интуиция лучше знания всего-на-свете, будь в хорошей умственной форме.
# Уважай других разработчиков и их труд.
# Критикуй, если можешь сделать лучше.
# Кодекс не абсолютен.

{{inrussian|Кодекс разработчика Blood Omnicide}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Portal:InRussian/Ликбез по моделированию</title>
    <ns>0</ns>
    <id>308</id>
      <sha1>kr170p6rm0dqs87cr7krgwp63qt6ldg</sha1>
    <revision>
      <id>2884</id>
      <timestamp>2012-11-22T13:18:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Небольшой список советов для начинающих 3D дизайнеров и недавно присоединившихся комрадов.  На ...&quot;</comment>
      <text xml:space="preserve" bytes="4924">Небольшой список советов для начинающих 3D дизайнеров и недавно присоединившихся комрадов.

На этой странице даются простые советы: что делать можно, и чего делать нельзя.

==Термины==

'''Нормаль треугольника (triangle normal)'''

Перпендикуляр к поверхности треугольника. Существует только в редакторе. В рендеринге используется нормаль вертексов.

'''Нормаль вертекса (vertex normal)'''

Складывается из суммы нормалей прилегающих к вертексу треугольников (может также быть выставлена вручную). Используется в рендеринге для затенения и параллакса.'''

'''Шейдер'''

1) программируемый блок видеокарты, выполняющий вычисления над вертексами или пикселями а также программа для этого блока.

2) .shader, Q3 Shader - система материалов, по синтаксису похожая на .shader файлы Quake 3 Arena (Id Tech 3). Q3Shader объединяет 3 вида свойств - физические, рендер-свойства (динамические и статические) и параметры игровой логики в единый материал, который может быть присвоен частям модели как обычная текстура.

==Советы==

# Обмен моделями желательно осуществлять в форматах: .3DS, .OBJ, MD3, .ASE, .blend.
# Модель должна быть низкополигональной. Для сравнения - шкаф это ~200 полигонов, персонажи - от 600 до 3000. Булавы в 14к полигонов и прочие зверства в игру вставляться не будут. На треугольниках делается базовый силуэт и сетка нормалей (vertex normals), мелкий рельеф делается через normalmap.
# Развертка - важная часть модели, она неотделима от сетки. Если не умеем разворачивать - учимся. Мнение что &quot;сделаю модель а другой развернет, так проще&quot; - неверное. В большинстве случаев, другому человеку проще будет сделать сетку заново и развернуть её, чем работать с вашей. К тому же, работа с разверткой помогает улучшить навыки работы с сеткой.
# Для быстрого просмотра моделей в различных форматах удобно использовать программу Deep Exploration.
# Хотя для просмотра Омницидовских моделек, лучше использовать Омницидовский же внутриигровой просмотрщик.
# Не стоит пытаться сделать модель Каина при отсутствии опыта моделирования персонажей - ничего не выйдет. Начинать лучше с маленьких моделей - столовых принадлежностей, ножей, книг, стульев и пр.
# Старайтесь избегать слишком вытянутых треугольников. При соединении с другими поверхностями под острым углом, они образуют слишком грубые vertex normals, что в свою очередь ведет к кривому затенению. Вытянутые треугольники безопасно применять в случаях когда нормали вертексов не сильно отличаются от нормали самих треугольников.
# При моделировании полезно использовать smoothing groups для корректной работы затенения.
# Красота заключается в ассиметричности и деталях, старайтесь избегать похожести одних элементов модели на другие, а также еще при создании меша сделать его узнаваемым по деталям силуэта.

{{inrussian|Ликбез по моделированию}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3290</id>
      <timestamp>2012-12-02T15:47:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Советы */</comment>
      <text xml:space="preserve" bytes="4904">Небольшой список советов для начинающих 3D дизайнеров и недавно присоединившихся комрадов.

На этой странице даются простые советы: что делать можно, и чего делать нельзя.

==Термины==

'''Нормаль треугольника (triangle normal)'''

Перпендикуляр к поверхности треугольника. Существует только в редакторе. В рендеринге используется нормаль вертексов.

'''Нормаль вертекса (vertex normal)'''

Складывается из суммы нормалей прилегающих к вертексу треугольников (может также быть выставлена вручную). Используется в рендеринге для затенения и параллакса.'''

'''Шейдер'''

1) программируемый блок видеокарты, выполняющий вычисления над вертексами или пикселями а также программа для этого блока.

2) .shader, Q3 Shader - система материалов, по синтаксису похожая на .shader файлы Quake 3 Arena (Id Tech 3). Q3Shader объединяет 3 вида свойств - физические, рендер-свойства (динамические и статические) и параметры игровой логики в единый материал, который может быть присвоен частям модели как обычная текстура.

==Советы==

# Обмен моделями желательно осуществлять в форматах: .MD3, .ASE
# Модель должна быть низкополигональной. Для сравнения - шкаф это ~200 полигонов, персонажи - от 600 до 3000. Булавы в 14к полигонов и прочие зверства в игру вставляться не будут. На треугольниках делается базовый силуэт и сетка нормалей (vertex normals), мелкий рельеф делается через normalmap.
# Развертка - важная часть модели, она неотделима от сетки. Если не умеем разворачивать - учимся. Мнение что &quot;сделаю модель а другой развернет, так проще&quot; - неверное. В большинстве случаев, другому человеку проще будет сделать сетку заново и развернуть её, чем работать с вашей. К тому же, работа с разверткой помогает улучшить навыки работы с сеткой.
# Для быстрого просмотра моделей в различных форматах удобно использовать программу Deep Exploration.
# Хотя для просмотра Омницидовских моделек, лучше использовать Омницидовский же внутриигровой просмотрщик.
# Не стоит пытаться сделать модель Каина при отсутствии опыта моделирования персонажей - ничего не выйдет. Начинать лучше с маленьких моделей - столовых принадлежностей, ножей, книг, стульев и пр.
# Старайтесь избегать слишком вытянутых треугольников. При соединении с другими поверхностями под острым углом, они образуют слишком грубые vertex normals, что в свою очередь ведет к кривому затенению. Вытянутые треугольники безопасно применять в случаях когда нормали вертексов не сильно отличаются от нормали самих треугольников.
# При моделировании полезно использовать smoothing groups для корректной работы затенения.
# Красота заключается в ассиметричности и деталях, старайтесь избегать похожести одних элементов модели на другие, а также еще при создании меша сделать его узнаваемым по деталям силуэта.

{{inrussian|Ликбез по моделированию}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Pulse monster</title>
    <ns>0</ns>
    <id>591</id>
      <sha1>ghgsnvfwdi4ktyfvle9z04yhclryemc</sha1>
    <revision>
      <id>3344</id>
      <timestamp>2012-12-27T21:32:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden2|bo_enemy_pulsemonster.gif|Pulse monster}} Artificially created humanoid (or, perhaps, was once a human) that roams Dark Eden grounds. Appear to be very flimsy:...&quot;</comment>
      <text xml:space="preserve" bytes="617">{{BoEnemy|eden2|bo_enemy_pulsemonster.gif|Pulse monster}}
Artificially created humanoid (or, perhaps, was once a human) that roams Dark Eden grounds. Appear to be very flimsy: thin arms and legs, bald head with no neck. Entire back is studded with long, sharp needle-like spines, which seem to rise from the body. Using ranged attack: tries to get close and shoot spikes in 8 directions.

==Stats==
:Health: 20
:Damage: 15
:Blood: green
:Walk speed: medium
:Character type: animal
:Entity: [[animal_pulsemonster]]

==Concept art gallery==
&lt;gallery&gt;
File:BO-Concept-Art-MutantConcept2.JPG
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Q3BSP</title>
    <ns>0</ns>
    <id>80</id>
      <sha1>g02p22lij5r80ezyl38etbpe6f08du2</sha1>
    <revision>
      <id>819</id>
      <timestamp>2012-07-16T12:10:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Q3BSP Stands For 'Quake 3 BSP'. It is a [[BSP]] file with version 49 used in Id Tech 3 games.  Q3BSP stores this lumps:  * Entities - game-related object descriptions. * Textu...&quot;</comment>
      <text xml:space="preserve" bytes="865">Q3BSP Stands For 'Quake 3 BSP'. It is a [[BSP]] file with version 49 used in Id Tech 3 games.

Q3BSP stores this lumps:

* Entities - game-related object descriptions.
* Textures - surface descriptions.
* Planes - planes used by map geometry.
* Nodes - BSP tree nodes.
* Leafs	- BSP tree leaves.
* Leaffaces - lists of face indices, one list per leaf.
* Leafbrushes - lists of brush indices, one list per leaf.
* Models - descriptions of rigid world geometry in map.
* Brushes - convex polyhedra used to describe solid space.
* Brushsides - brush surfaces.
* Vertexes - vertices used to describe faces.
* Meshverts - lists of offsets, one list per mesh.
* Effects - list of special map effects.
* Faces - surface geometry.
* Lightmaps - packed lightmap data.
* Lightvols - local illumination data.
* Visdata - cluster-cluster visibility data.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>820</id>
      <timestamp>2012-07-16T12:11:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="887">Q3BSP stands for 'Quake 3 BSP'. It is a [[BSP]] file with version 49 used in Id Tech 3 games and Darkplaces engine.

Q3BSP stores this lumps:

* Entities - game-related object descriptions.
* Textures - surface descriptions.
* Planes - planes used by map geometry.
* Nodes - BSP tree nodes.
* Leafs	- BSP tree leaves.
* Leaffaces - lists of face indices, one list per leaf.
* Leafbrushes - lists of brush indices, one list per leaf.
* Models - descriptions of rigid world geometry in map.
* Brushes - convex polyhedra used to describe solid space.
* Brushsides - brush surfaces.
* Vertexes - vertices used to describe faces.
* Meshverts - lists of offsets, one list per mesh.
* Effects - list of special map effects.
* Faces - surface geometry.
* Lightmaps - packed lightmap data.
* Lightvols - local illumination data.
* Visdata - cluster-cluster visibility data.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1050</id>
      <timestamp>2012-07-17T20:35:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="869">Q3BSP stands for 'Quake 3 BSP'. It is a [[BSP]] file with version 49 used in Id Tech 3 games and Darkplaces engine.

Lumps:

* Entities - game-related object descriptions.
* Textures - surface descriptions.
* Planes - planes used by map geometry.
* Nodes - BSP tree nodes.
* Leafs	- BSP tree leaves.
* Leaffaces - lists of face indices, one list per leaf.
* Leafbrushes - lists of brush indices, one list per leaf.
* Models - descriptions of rigid world geometry in map.
* Brushes - convex polyhedra used to describe solid space.
* Brushsides - brush surfaces.
* Vertexes - vertices used to describe faces.
* Meshverts - lists of offsets, one list per mesh.
* Effects - list of special map effects.
* Faces - surface geometry.
* Lightmaps - packed lightmap data.
* Lightvols - local illumination data.
* Visdata - cluster-cluster visibility data.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1051</id>
      <timestamp>2012-07-17T20:36:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="919">Q3BSP stands for 'Quake 3 BSP'. It is a [[BSP]] file with version 49 used in Id Tech 3 games and Darkplaces engine.

Quake 3 BSP stores this data lumps:

* Entities - game-related object descriptions.
* Textures - surface descriptions.
* Planes - planes used by map geometry.
* Nodes - BSP tree nodes.
* Leafs	- BSP tree leaves.
* Leaffaces - lists of face indices, one list per leaf.
* Leafbrushes - lists of brush indices, one list per leaf.
* Models - descriptions of rigid world geometry in map.
* Brushes - convex polyhedra used to describe solid space.
* Brushsides - brush surfaces.
* Vertexes - vertices used to describe faces.
* Meshverts - lists of offsets, one list per mesh.
* Effects - list of special map effects.
* Faces - surface geometry.
* Lightmaps - packed lightmap data.
* Lightgrid - 3d lightmap used for model diffuse lightning.
* Visdata - cluster-cluster visibility data.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1389</id>
      <timestamp>2012-07-22T17:27:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="932">Q3BSP stands for 'Quake 3 BSP'. It is a [[BSP (file) | BSP file]] with version 49 used in Id Tech 3 games and Darkplaces engine.

Quake 3 BSP stores this data lumps:

* Entities - game-related object descriptions.
* Textures - surface descriptions.
* Planes - planes used by map geometry.
* Nodes - BSP tree nodes.
* Leafs	- BSP tree leaves.
* Leaffaces - lists of face indices, one list per leaf.
* Leafbrushes - lists of brush indices, one list per leaf.
* Models - descriptions of rigid world geometry in map.
* Brushes - convex polyhedra used to describe solid space.
* Brushsides - brush surfaces.
* Vertexes - vertices used to describe faces.
* Meshverts - lists of offsets, one list per mesh.
* Effects - list of special map effects.
* Faces - surface geometry.
* Lightmaps - packed lightmap data.
* Lightgrid - 3d lightmap used for model diffuse lightning.
* Visdata - cluster-cluster visibility data.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2310</id>
      <timestamp>2012-07-30T21:57:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="947">{{unfinished}}
Q3BSP stands for 'Quake 3 BSP'. It is a [[BSP (file) | BSP file]] with version 49 used in Id Tech 3 games and Darkplaces engine.

Quake 3 BSP stores this data lumps:

* Entities - game-related object descriptions.
* Textures - surface descriptions.
* Planes - planes used by map geometry.
* Nodes - BSP tree nodes.
* Leafs	- BSP tree leaves.
* Leaffaces - lists of face indices, one list per leaf.
* Leafbrushes - lists of brush indices, one list per leaf.
* Models - descriptions of rigid world geometry in map.
* Brushes - convex polyhedra used to describe solid space.
* Brushsides - brush surfaces.
* Vertexes - vertices used to describe faces.
* Meshverts - lists of offsets, one list per mesh.
* Effects - list of special map effects.
* Faces - surface geometry.
* Lightmaps - packed lightmap data.
* Lightgrid - 3d lightmap used for model diffuse lightning.
* Visdata - cluster-cluster visibility data.

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>Radiant/General reference</title>
    <ns>0</ns>
    <id>92</id>
      <sha1>1v5kkw1pawiiknhvkik9pgce36bie6l</sha1>
    <revision>
      <id>896</id>
      <timestamp>2012-07-16T19:47:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Introduction tutorials ==  * First room * Creating a walls * Creating a floors * Placing spawn points * Getting into the game * Placing ingame lights  == Tools reference ==...&quot;</comment>
      <text xml:space="preserve" bytes="282">== Introduction tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating</text>
    </revision>
    <revision>
      <id>897</id>
      <timestamp>2012-07-16T19:48:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="306">{{article unfinished}}

== Introduction tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating</text>
    </revision>
    <revision>
      <id>904</id>
      <timestamp>2012-07-16T19:52:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Radiant/Introduction]] to [[Radiant general reference]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="306">{{article unfinished}}

== Introduction tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating</text>
    </revision>
    <revision>
      <id>906</id>
      <timestamp>2012-07-16T19:56:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="437">{{article unfinished}}

== Introduction ==

* Starting up NetRadiant
* Working with levels
* [[Radiant Glossary | Radiant glossary]]

== Tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating
* Region tool, Hide/Show, Filters</text>
    </revision>
    <revision>
      <id>2003</id>
      <timestamp>2012-07-27T14:01:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="429">{{unfinished}}

== Introduction ==

* Starting up NetRadiant
* Working with levels
* [[Radiant Glossary | Radiant glossary]]

== Tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating
* Region tool, Hide/Show, Filters</text>
    </revision>
    <revision>
      <id>2689</id>
      <timestamp>2012-09-25T21:05:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="427">{{unfinished}}

== Introduction ==

* Starting up NetRadiant
* Working with levels
* [[Radiant/Glossary|Radiant glossary]]

== Tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating
* Region tool, Hide/Show, Filters</text>
    </revision>
    <revision>
      <id>2690</id>
      <timestamp>2012-09-25T21:06:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Radiant general reference]] to [[Radiant/General reference]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="427">{{unfinished}}

== Introduction ==

* Starting up NetRadiant
* Working with levels
* [[Radiant/Glossary|Radiant glossary]]

== Tutorials ==

* First room
* Creating a walls
* Creating a floors
* Placing spawn points
* Getting into the game
* Placing ingame lights

== Tools reference ==

* Brush manipulating
* The CSG operations
* The Clipper
* Edge &amp; Vertex editing
* Patch mesh manipulating
* Region tool, Hide/Show, Filters</text>
    </revision>
    <revision>
      <id>3613</id>
      <timestamp>2013-03-12T08:52:56Z</timestamp>
      <contributor>
        <ip>212.232.33.42</ip>
      </contributor>
      <text xml:space="preserve" bytes="500">{{unfinished}}

== Chapters==
&lt;font size=3&gt;
# Starting up NetRadiant
# Editor Interface
# Building levels
# [[Radiant/Glossary|Radiant glossary]]
&lt;/font&gt;

== Tutorials ==
&lt;font size=3&gt;
# First room
# Creating a walls
# Creating a floors
# Placing spawn points
# Getting into the game
# Placing ingame lights
&lt;/font&gt;

== Tools reference ==
&lt;font size=3&gt;
# Brush manipulating
# The CSG operations
# The Clipper
# Edge &amp; Vertex editing
# Patch mesh manipulating
# Region tool, Hide/Show, Filters
&lt;/font&gt;</text>
    </revision>
  </page>
  <page>
    <title>Radiant/Glossary</title>
    <ns>0</ns>
    <id>91</id>
      <sha1>akp8vz63y7do1egf7b2t1ptgwh8yc47</sha1>
    <revision>
      <id>876</id>
      <timestamp>2012-07-16T19:09:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;====A==== '''Alpha Shadows''' A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textur...&quot;</comment>
      <text xml:space="preserve" bytes="5955">====A====
'''Alpha Shadows'''
A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
A [[common materials | common material]] designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.

'''Clipper'''
The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions:
* two-point clip cuts along a single plane
* three-point clip can create a cut along all three dimensions, depending on point placement.

====D====
'''Detail brush'''
A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
: A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in GtkRadiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
: A light is an entity that creates light and adds color to surfaces of brushes around it.  Proper lighting can make any map look appealing.

====M====

;&lt;span id=&quot;model&quot; style=&quot;font-weight: bold&quot;&gt;Model&lt;/span&gt;
:A model is a premade piece of geometry which you can put into your map. The models available differ from game to game.

====N====

;&lt;span id=&quot;npc&quot; style=&quot;font-weight: bold&quot;&gt;Npc&lt;/span&gt;
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.

====O====
;&lt;span id=&quot;origin&quot; style=&quot;font-weight: bold&quot;&gt;Origin&lt;/span&gt;
: The center point of the map, i.e. &lt;tt&gt;0,0,0&lt;/tt&gt;.

====P====
;&lt;span id=&quot;patchmesh&quot; style=&quot;font-weight: bold&quot;&gt;Patch Mesh&lt;/span&gt;
: A sub-type of brush used to simulate curves in the Quake 3 engine. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. GtkRadiant has three standard types (Bevel, Endcap, and Cylinder) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
;&lt;span id=&quot;prefab&quot; style=&quot;font-weight: bold&quot;&gt;Prefab&lt;/span&gt;
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs sill consist of individual brushes whereas models are made out of already compiled polygons.

====Q====
;&lt;span id=&quot;Q3Map&quot; style=&quot;font-weight: bold&quot;&gt;Q3Map&lt;/span&gt;
:''Q3Map2'' The original tool created by Id to compile maps for the 'id tech 3' engine.
;&lt;span id=&quot;Q3Map2&quot; style=&quot;font-weight: bold&quot;&gt;Q3Map2&lt;/span&gt;
:''Q3Map2'' Vastly improved Q3Map by ydnar.

====R====
====S====
;&lt;span id=&quot;script&quot; style=&quot;font-weight: bold&quot;&gt;Script&lt;/span&gt;
: A script is a set of written instructions used by the Quake 3 Engine to produce certain specific effects. There are two primary types - ''Shaders'' and ''Icarus Scripts''. Typically, usage of the word script in forums or other media is a reference to the later, while the former is commonly referred to as a shader. Icarus Scripts are used to create effects in-game that can do anything from move a brush or set of brushes from point A to point B all the way to full Cinematics in SP games.
;&lt;span id=&quot;shader&quot; style=&quot;font-weight: bold&quot;&gt;Shader&lt;/span&gt;
: A script which defines the properties of the surface it is applied to. In fact, all textures which don't have a shader associated to them automatically get a default shader. Shaders are used to make lights glow, make floors be reflective, or make things non-solid or even water. Actually any special property a surface has is set by its shader. There are also many default shaders that come with the game such as {{GtkRGloss|caulk|''caulk''}}. In GtkRadiant all shaders have a white border around them when browsed in the textures browser.

====T====
;&lt;span id=&quot;texture&quot; style=&quot;font-weight: bold&quot;&gt;Texture&lt;/span&gt;
: An image or graphic which can be applied to a surface. See also {{GtkRGloss|shader|shader}}.

====U====
====V====
;&lt;span id=&quot;vertex&quot; style=&quot;font-weight: bold&quot;&gt;Vertex&lt;/span&gt;
: The points between which the faces of the brush are drawn, usually the corners of a brush.
;&lt;span id=&quot;void&quot; style=&quot;font-weight: bold&quot;&gt;Void&lt;/span&gt;
: The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
;&lt;span id=&quot;worldspawn&quot; style=&quot;font-weight: bold&quot;&gt;Worldspawn&lt;/span&gt;
: The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity.

====X====
====Y====
====Z====
;&lt;span id=&quot;zfighting&quot; style=&quot;font-weight: bold&quot;&gt;Z-Fighting&lt;/span&gt;
: A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.</text>
    </revision>
    <revision>
      <id>877</id>
      <timestamp>2012-07-16T19:13:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6042">====A====
'''Alpha Shadows'''
A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
A [[common materials | common material]] designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.

'''Clipper'''
The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions:
* two-point clip cuts along a single plane
* three-point clip can create a cut along all three dimensions, depending on point placement.

====D====
'''Detail brush'''
A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
;&lt;span id=&quot;patchmesh&quot; style=&quot;font-weight: bold&quot;&gt;Patch Mesh&lt;/span&gt;
: A sub-type of brush used to simulate curves in the Quake 3 engine. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. GtkRadiant has three standard types (Bevel, Endcap, and Cylinder) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
;&lt;span id=&quot;prefab&quot; style=&quot;font-weight: bold&quot;&gt;Prefab&lt;/span&gt;
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs sill consist of individual brushes whereas models are made out of already compiled polygons.

====Q====
;&lt;span id=&quot;Q3Map&quot; style=&quot;font-weight: bold&quot;&gt;Q3Map&lt;/span&gt;
:''Q3Map2'' The original tool created by Id to compile maps for the 'id tech 3' engine.
;&lt;span id=&quot;Q3Map2&quot; style=&quot;font-weight: bold&quot;&gt;Q3Map2&lt;/span&gt;
:''Q3Map2'' Vastly improved Q3Map by ydnar.

====R====
====S====
;&lt;span id=&quot;script&quot; style=&quot;font-weight: bold&quot;&gt;Script&lt;/span&gt;
: A script is a set of written instructions used by the Quake 3 Engine to produce certain specific effects. There are two primary types - ''Shaders'' and ''Icarus Scripts''. Typically, usage of the word script in forums or other media is a reference to the later, while the former is commonly referred to as a shader. Icarus Scripts are used to create effects in-game that can do anything from move a brush or set of brushes from point A to point B all the way to full Cinematics in SP games.
;&lt;span id=&quot;shader&quot; style=&quot;font-weight: bold&quot;&gt;Shader&lt;/span&gt;
: A script which defines the properties of the surface it is applied to. In fact, all textures which don't have a shader associated to them automatically get a default shader. Shaders are used to make lights glow, make floors be reflective, or make things non-solid or even water. Actually any special property a surface has is set by its shader. There are also many default shaders that come with the game such as {{GtkRGloss|caulk|''caulk''}}. In GtkRadiant all shaders have a white border around them when browsed in the textures browser.

====T====
;&lt;span id=&quot;texture&quot; style=&quot;font-weight: bold&quot;&gt;Texture&lt;/span&gt;
: An image or graphic which can be applied to a surface. See also {{GtkRGloss|shader|shader}}.

====U====
====V====
;&lt;span id=&quot;vertex&quot; style=&quot;font-weight: bold&quot;&gt;Vertex&lt;/span&gt;
: The points between which the faces of the brush are drawn, usually the corners of a brush.
;&lt;span id=&quot;void&quot; style=&quot;font-weight: bold&quot;&gt;Void&lt;/span&gt;
: The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
;&lt;span id=&quot;worldspawn&quot; style=&quot;font-weight: bold&quot;&gt;Worldspawn&lt;/span&gt;
: The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity.

====X====
====Y====
====Z====
;&lt;span id=&quot;zfighting&quot; style=&quot;font-weight: bold&quot;&gt;Z-Fighting&lt;/span&gt;
: A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>878</id>
      <timestamp>2012-07-16T19:13:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="6044">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
A [[common materials | common material]] designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.

'''Clipper'''
The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions:
* two-point clip cuts along a single plane
* three-point clip can create a cut along all three dimensions, depending on point placement.

====D====
'''Detail brush'''
A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
;&lt;span id=&quot;patchmesh&quot; style=&quot;font-weight: bold&quot;&gt;Patch Mesh&lt;/span&gt;
: A sub-type of brush used to simulate curves in the Quake 3 engine. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. GtkRadiant has three standard types (Bevel, Endcap, and Cylinder) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
;&lt;span id=&quot;prefab&quot; style=&quot;font-weight: bold&quot;&gt;Prefab&lt;/span&gt;
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs sill consist of individual brushes whereas models are made out of already compiled polygons.

====Q====
;&lt;span id=&quot;Q3Map&quot; style=&quot;font-weight: bold&quot;&gt;Q3Map&lt;/span&gt;
:''Q3Map2'' The original tool created by Id to compile maps for the 'id tech 3' engine.
;&lt;span id=&quot;Q3Map2&quot; style=&quot;font-weight: bold&quot;&gt;Q3Map2&lt;/span&gt;
:''Q3Map2'' Vastly improved Q3Map by ydnar.

====R====
====S====
;&lt;span id=&quot;script&quot; style=&quot;font-weight: bold&quot;&gt;Script&lt;/span&gt;
: A script is a set of written instructions used by the Quake 3 Engine to produce certain specific effects. There are two primary types - ''Shaders'' and ''Icarus Scripts''. Typically, usage of the word script in forums or other media is a reference to the later, while the former is commonly referred to as a shader. Icarus Scripts are used to create effects in-game that can do anything from move a brush or set of brushes from point A to point B all the way to full Cinematics in SP games.
;&lt;span id=&quot;shader&quot; style=&quot;font-weight: bold&quot;&gt;Shader&lt;/span&gt;
: A script which defines the properties of the surface it is applied to. In fact, all textures which don't have a shader associated to them automatically get a default shader. Shaders are used to make lights glow, make floors be reflective, or make things non-solid or even water. Actually any special property a surface has is set by its shader. There are also many default shaders that come with the game such as {{GtkRGloss|caulk|''caulk''}}. In GtkRadiant all shaders have a white border around them when browsed in the textures browser.

====T====
;&lt;span id=&quot;texture&quot; style=&quot;font-weight: bold&quot;&gt;Texture&lt;/span&gt;
: An image or graphic which can be applied to a surface. See also {{GtkRGloss|shader|shader}}.

====U====
====V====
;&lt;span id=&quot;vertex&quot; style=&quot;font-weight: bold&quot;&gt;Vertex&lt;/span&gt;
: The points between which the faces of the brush are drawn, usually the corners of a brush.
;&lt;span id=&quot;void&quot; style=&quot;font-weight: bold&quot;&gt;Void&lt;/span&gt;
: The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
;&lt;span id=&quot;worldspawn&quot; style=&quot;font-weight: bold&quot;&gt;Worldspawn&lt;/span&gt;
: The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity.

====X====
====Y====
====Z====
;&lt;span id=&quot;zfighting&quot; style=&quot;font-weight: bold&quot;&gt;Z-Fighting&lt;/span&gt;
: A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>880</id>
      <timestamp>2012-07-16T19:23:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4848">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
:A [[common materials | common material]] designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.

'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.

====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
: Refers to [[Material system | material]].

====T====
;&lt;span id=&quot;texture&quot; style=&quot;font-weight: bold&quot;&gt;Texture&lt;/span&gt;
: An image or graphic which can be applied to a surface. See also {{GtkRGloss|shader|shader}}.

====U====
====V====
;&lt;span id=&quot;vertex&quot; style=&quot;font-weight: bold&quot;&gt;Vertex&lt;/span&gt;
: The points between which the faces of the brush are drawn, usually the corners of a brush.
;&lt;span id=&quot;void&quot; style=&quot;font-weight: bold&quot;&gt;Void&lt;/span&gt;
: The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
;&lt;span id=&quot;worldspawn&quot; style=&quot;font-weight: bold&quot;&gt;Worldspawn&lt;/span&gt;
: The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity.

====X====
====Y====
====Z====
;&lt;span id=&quot;zfighting&quot; style=&quot;font-weight: bold&quot;&gt;Z-Fighting&lt;/span&gt;
: A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>881</id>
      <timestamp>2012-07-16T19:26:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4633">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
:A [[common materials | common material]] designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.

'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.

====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>882</id>
      <timestamp>2012-07-16T19:27:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4753">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.

====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>886</id>
      <timestamp>2012-07-16T19:32:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5251">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only requires origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.
'''Volume entity'''
:Brush-based entity requires some level geometry to define it's volume. So effectively it's a [[BModel]]. Before creating of volume entity, should make some brushes and select them. Trains, moving walls, touchable triggers, zones - are volume entities.


====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>892</id>
      <timestamp>2012-07-16T19:39:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Radiant Glossary]] to [[Radiant/Glossary]] without leaving a redirect: Better name</comment>
      <text xml:space="preserve" bytes="5251">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].

====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only requires origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.
'''Volume entity'''
:Brush-based entity requires some level geometry to define it's volume. So effectively it's a [[BModel]]. Before creating of volume entity, should make some brushes and select them. Trains, moving walls, touchable triggers, zones - are volume entities.


====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>895</id>
      <timestamp>2012-07-16T19:45:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5356">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only requires origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

__NOTOC__</text>
    </revision>
    <revision>
      <id>899</id>
      <timestamp>2012-07-16T19:49:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5379">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only requires origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>901</id>
      <timestamp>2012-07-16T19:51:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Radiant/Glossary]] to [[Radiant Glossary]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="5379">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only requires origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1270</id>
      <timestamp>2012-07-19T15:36:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5378">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1904</id>
      <timestamp>2012-07-27T09:21:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5389">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>2300</id>
      <timestamp>2012-07-30T21:52:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="5401">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player. 

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2653</id>
      <timestamp>2012-09-25T10:52:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* N */</comment>
      <text xml:space="preserve" bytes="5757">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase, requires -meta).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2654</id>
      <timestamp>2012-09-25T10:55:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* N */</comment>
      <text xml:space="preserve" bytes="5842">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline.

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2655</id>
      <timestamp>2012-09-25T10:56:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* N */</comment>
      <text xml:space="preserve" bytes="5854">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2656</id>
      <timestamp>2012-09-25T11:12:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* M */</comment>
      <text xml:space="preserve" bytes="6433">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====

'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2657</id>
      <timestamp>2012-09-25T11:12:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* M */</comment>
      <text xml:space="preserve" bytes="6431">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2658</id>
      <timestamp>2012-09-25T11:16:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* S */</comment>
      <text xml:space="preserve" bytes="6650">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2659</id>
      <timestamp>2012-09-25T11:17:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* E */</comment>
      <text xml:space="preserve" bytes="6715">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2660</id>
      <timestamp>2012-09-25T12:13:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* S */</comment>
      <text xml:space="preserve" bytes="7555">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Shadow groups'''
:Per-entity shadow groups set with &quot;_cs&quot; (cast shadows) and &quot;_rs&quot; (receive shadows) keys. Shadows groups are used to control how object do cast lightmap shadows (they have nothing to do with realtime shadows). Shadows groups are applied during lightmapping of an object using this rules:
:1. If object receive shadows is 1 (default), it will only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
:3. If object receive shadows is &gt; 1, it will only receive shadows from objects with same abs(cast shadows) and worldspawn.
:2. If object receive shadows is &lt; 1, it will only receive shadows from objects with same abs(cast shadows) and no worldspawn.
:By default worldspawn and func_group have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2672</id>
      <timestamp>2012-09-25T16:57:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* S */</comment>
      <text xml:space="preserve" bytes="6715">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn.

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2683</id>
      <timestamp>2012-09-25T20:54:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* W */</comment>
      <text xml:space="preserve" bytes="6735">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface.

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2684</id>
      <timestamp>2012-09-25T20:54:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* T */</comment>
      <text xml:space="preserve" bytes="6752">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing averages normals of coincident vertexes between brush faces whose angle is greater than smooth normals 'break' angle. Normal smoothing can be set explicitly on entity with &quot;_np&quot; &quot;degrees&quot; key or on all entities by ''-np degrees'' compiler key (affects BSP phase). A valid break angle is from 1 to 179 degrees. Normal smoothing only works with metasurface pipeline (see above).

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface. See [[texture]].

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2685</id>
      <timestamp>2012-09-25T20:56:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* N */</comment>
      <text xml:space="preserve" bytes="6431">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing allows soft lighting on them. See [[normal smoothing]].

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface. See [[texture]].

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2686</id>
      <timestamp>2012-09-25T20:58:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* C */</comment>
      <text xml:space="preserve" bytes="6670">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.
'''CSG'''
:Consecutive Solid Geometry. A geometry class that represents both form and volume used on [[brush|brushes]] (triangle models dont represent a volume). Radiant allows three basic CSG operations: Substract, Make Hollow and Merge.

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing allows soft lighting on them. See [[normal smoothing]].

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface. See [[texture]].

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2687</id>
      <timestamp>2012-09-25T21:05:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="7549">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''BSP'''
:Name of playable map format, a technique of scene rendering and collision detection, first compile stage when .MAP (editing format) is actually transformed to .BSP. See [[BSP]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.
'''CSG'''
:Consecutive Solid Geometry. A geometry class that represents both form and volume used on [[brush|brushes]] (triangle models dont represent a volume). Radiant allows three basic CSG operations: Substract, Make Hollow and Merge.
'''Compilation'''
:A process of transforming .MAP (editing format) file into .BSP file (playable map) when map is optimized and lighting, culling, and collision structures are created. Compilation can take many time based on quality settings (there is preview, final and release compilation) and map type. See [[Radiant/Build menu|Build menu]].

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''LIGHT'''
:Third (and last) compile stage that creates lightmaps and vertex lighting for a map. On outdoor maps it is most long stage. 
'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Map'''
:A level editing format (which get transformed into playable format during map compilation), a single map (or scene).
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing allows soft lighting on them. See [[normal smoothing]].

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface. See [[texture]].

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''VIS'''
:Second compile stage where [[VIS]] are being calculated for a map. 
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2688</id>
      <timestamp>2012-09-25T21:05:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Radiant Glossary]] to [[Radiant/Glossary]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="7549">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''BSP'''
:Name of playable map format, a technique of scene rendering and collision detection, first compile stage when .MAP (editing format) is actually transformed to .BSP. See [[BSP]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.
'''CSG'''
:Consecutive Solid Geometry. A geometry class that represents both form and volume used on [[brush|brushes]] (triangle models dont represent a volume). Radiant allows three basic CSG operations: Substract, Make Hollow and Merge.
'''Compilation'''
:A process of transforming .MAP (editing format) file into .BSP file (playable map) when map is optimized and lighting, culling, and collision structures are created. Compilation can take many time based on quality settings (there is preview, final and release compilation) and map type. See [[Radiant/Build menu|Build menu]].

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''LIGHT'''
:Third (and last) compile stage that creates lightmaps and vertex lighting for a map. On outdoor maps it is most long stage. 
'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Map'''
:A level editing format (which get transformed into playable format during map compilation), a single map (or scene).
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing allows soft lighting on them. See [[normal smoothing]].

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.


====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface. See [[texture]].

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''VIS'''
:Second compile stage where [[VIS]] are being calculated for a map. 
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2692</id>
      <timestamp>2012-09-25T21:12:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* P */</comment>
      <text xml:space="preserve" bytes="7572">====A====
'''Alpha Shadows'''
:A technique for lighting in a map that results in controlled shadows in the finished map. Typically, it is used to project shadows through textures such as grates or glass that are partially or mostly  transparent, simulating realistic shadowing on the recieving surface.

====B====
'''Brush'''
:The basic building block of Radiant. See [[brush]].
'''BSP'''
:Name of playable map format, a technique of scene rendering and collision detection, first compile stage when .MAP (editing format) is actually transformed to .BSP. See [[BSP]].
'''Brush entity'''
:Entity which need to be paired with at least one brush to work. This entity type is populating the subgroups func_, trigger_ and _zone. To create a brush entity, first create a brush and select it, then right-click anywhere in the 2D grid to bring up the entity menu and select the entity. When map is compiled, brush entity become worldspawn or [[BModel]].


====C====
'''Caulk'''
:Special material designed to 'caulk' or seal a map. In-game, it is a transparent solid texture. It is best applied to all surfaces which a player will be unable to see while in-game.
'''Clipper'''
:The Clipper Tool is used to clip (IE, cut away) parts of a brush in order to alter it's shape. This is generally used to turn a standard 6 sided brush into a brush with fewer or more sides, depending on what is required for it's placement. It has two versions: two-point clip cuts along a single plane and three-point clip can create a cut along all three dimensions, depending on point placement.
'''Common materials'''
:A set of system materials in common/ folder used to make special things. All common material normally invisible in game.
'''CSG'''
:Consecutive Solid Geometry. A geometry class that represents both form and volume used on [[brush|brushes]] (triangle models dont represent a volume). Radiant allows three basic CSG operations: Substract, Make Hollow and Merge.
'''Compilation'''
:A process of transforming .MAP (editing format) file into .BSP file (playable map) when map is optimized and lighting, culling, and collision structures are created. Compilation can take many time based on quality settings (there is preview, final and release compilation) and map type. See [[Radiant/Build menu|Build menu]].

====D====
'''Detail brush'''
:A detail brush is a type of brush that does not block the -VIS stage of the compiler. In short, any brush that does not provide structure/seal to a room, and merely is there to detail the room, should be made a detail brush [ctrl + M]. See also [[brush]].

====E====
'''Entity'''
:An object used to interact with the game, see [[entity]].
'''Classname'''
:String entity key that represents entity class.

====F====
====G====
'''Grid'''
:A grid is a framework with vertical and horizontal lines in unison used to structure content. The grid, in Radiant, is to the left, where you build your world.

====H====
====I====
====J====
====K====
====L====

'''LIGHT'''
:Third (and last) compile stage that creates lightmaps and vertex lighting for a map. On outdoor maps it is most long stage. 
'''Light'''
:A light is an entity that creates light and adds color to surfaces of brushes around it. Proper lighting can make any map look appealing. Darkplaces engine have static map-placed light entities and dynamic realtime lights edited ingame (some of them get exported to static lights on map compile).

====M====
'''Map'''
:A level editing format (which get transformed into playable format during map compilation), a single map (or scene).
'''Metasurface pipeline'''
:A technique used on BSP map compilation phase. All brushes and models are breaked into their triangles and new drawsurfaces is created from that pile. Metasurface pipeline is needed for most of advanced map compilation features (models lightmapping, normal smoothing) and required by Blood Omnicide.
'''Model'''
:A model is a premade piece of geometry which you can put into your map. By default models get only vertex lighting, but with &quot;force meta/lightmapped&quot; spawnflag they get lightmaps compiled. Models become a part of the world unless targeted to other entities (in this case model is being added to targeted entity geometry).

====N====
'''Npc'''
:Npc is an abbreviation of non-player character (sometimes &quot;non-playable character&quot; or &quot;non-player class&quot;). It's a character in a computer game whose actions are not controlled by a human player.
'''Normal smoothing'''
:Brushes are flat shaded by default. Normal smoothing allows soft lighting on them. See [[normal smoothing]].

====O====
'''Origin'''
:The center point of the map, i.e. ''0,0,0''. Also center of any object and [[common materials | common material]] used to define origin of [[BModel | bmodel]].

====P====
'''Patch Mesh'''
:A sub-type of brush used to simulate curves. It is generated by a matrix of vertexes which can be moved independently of each other to form the curved shape. NetRadiant has several standard types (Bevel, Endcap, Cylinder, Sphere) that will generate most needed curves, as well as the ability to create 'simple patch meshes' that allow for a free-form shaping. Patch Meshes are only visible from one side, and cannot be used reliably for fog, water, or any other spatial type of shader effect.
'''Prefab'''
:A ''prefab'' are a group of brushes which can be imported to your map. The difference between a ''prefab'' and a model are that prefabs still consist of individual brushes whereas models are made out of already compiled polygons. Prefabs are .map files.
'''Point entity'''
:Any entity that only require origin to be placed. Is is a most frequently used entity. Point entity have fixed volume box (bound box). Enemies, items, decoration models, start spots are point entities.

====Q====
'''Q3Map2'''
:Vastly improved original tool for Id Tech 3 to compile levels into the [[Q3BSP]] format (the ''playable'' format).

====R====
====S====
'''Script'''
:A script is a set of written instructions used by gamecode or engine to produce certain specific effects.

'''Shader'''
:Refers to [[Darkplaces material system | material]].

'''Spawnflags'''
:Spawnflags key is special entity key used by Radiant to assign boolean entity properties. Possible spawnflags for entityclass are shown above keys in entity inspector. Spawnflags can address 24 bits.

====T====
'''Texture'''
:An image or graphic which can be applied to a surface. See [[texture]].

====U====
====V====
'''Vertex'''
:The points between which the faces of the brush are drawn, usually the corners of a brush.
'''VIS'''
:Second compile stage where [[VIS]] are being calculated for a map. 
'''Void'''
:The gray area outside of the map itself, where nothing is. If there's a way to get to this area from any entity in the map, the map is leaked.

====W====
'''Worldspawn'''
:The entity that contains all the regular brushes in your map, so every brush you create will be added to the worldspawn entity. Any dynamic brushes (doors, trains) are not part of worldspawn. See [[worldspawn]].

====X====
====Y====
====Z====
'''Z-Fighting'''
:A common mapping error relating to texture placement and brush alignment. It is cause when the faces of two brushes either completely or partially occupy the same plane, and are textured with either two different textures or the same texture with different settings. Visually in game, it is characterized by that plane showing both textures at the same time on that face, resulting is what looks like the textures 'fighting' to be shown.

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference</title>
    <ns>0</ns>
    <id>202</id>
      <sha1>6h6gjs7olslpmrmh7mgkxc7qeu6jdg3</sha1>
    <revision>
      <id>2366</id>
      <timestamp>2012-08-01T13:47:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{WIP}} This reference explains a structure of Blood Omnicide SVN repository.  ==Introduction== Blood Omnicide repository stores all files needed for the development process o...&quot;</comment>
      <text xml:space="preserve" bytes="4337">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Introduction==
Blood Omnicide repository stores all files needed for the development process of Blood Omnicide. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

===Getting a working copy===
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository. Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 Wrong:
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 Correct:
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB HDD speace, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

===Looking around===
When download will be completed, you will see such folders in repository:

* '''bin32''' - game binaries for x86 platform
* '''devkit''' - game sourcecodes and tools
* '''kain''' - gamedir, all of Blood Omnicide files (textures, maps, scripts etc.)
* '''kain_make''' - installation scripts and scripts to make installer
* '''mapeditor''' - level editor
* '''misc''' - help files, icons, map shots etc.

==Key Concepts==

===Development vs Release===
Blood Omnicide version that will be released is different from what you get in repository. Basically, in released version all development-related files are removed (except from ones leaved for SDK), all textures is compressed to [[DDS]] files and all game files are packed into the [[PK3]] archives in order to save HDD space and raise loading time. With all of this operations, 'builded' version fo the game weights about 800Mb.

===Linked to Blood Omen===
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. Installation of Blood Omen files are done when Blood Omnicide builded version is being installed on a computer. Development version doesnt have such installer, but it have a test installation scripts, which does the same job. This is called test installation.  

===Sources are saved===
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources:''' Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources:''' This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

===Conventions===
A number of rules that should be followed in order to keep repository clean.

'''Files names:''' All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits:''' Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, event if it was deleted. So abusing it with many unused files will waste HDD space.

====Learn SVN====
This was already mentioned in introduction. Good knowledge of SVN will help to avoid many problems. 

==Building a Game==

===Test installation===

===Updating===
This is second SVN command to deal when wortking with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.</text>
    </revision>
    <revision>
      <id>2367</id>
      <timestamp>2012-08-01T13:50:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="4338">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Introduction==
Blood Omnicide repository stores all files needed for the development process of Blood Omnicide. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

===Getting a working copy===
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 Wrong:
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 Correct:
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB HDD speace, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

===Looking around===
When download will be completed, you will see such folders in repository:

* '''bin32''' - game binaries for x86 platform
* '''devkit''' - game sourcecodes and tools
* '''kain''' - gamedir, all of Blood Omnicide files (textures, maps, scripts etc.)
* '''kain_make''' - installation scripts and scripts to make installer
* '''mapeditor''' - level editor
* '''misc''' - help files, icons, map shots etc.

==Key Concepts==

===Development vs Release===
Blood Omnicide version that will be released is different from what you get in repository. Basically, in released version all development-related files are removed (except from ones leaved for SDK), all textures is compressed to [[DDS]] files and all game files are packed into the [[PK3]] archives in order to save HDD space and raise loading time. With all of this operations, 'builded' version fo the game weights about 800Mb.

===Linked to Blood Omen===
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. Installation of Blood Omen files are done when Blood Omnicide builded version is being installed on a computer. Development version doesnt have such installer, but it have a test installation scripts, which does the same job. This is called test installation.  

===Sources are saved===
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources:''' Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources:''' This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

===Conventions===
A number of rules that should be followed in order to keep repository clean.

'''Files names:''' All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits:''' Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, event if it was deleted. So abusing it with many unused files will waste HDD space.

====Learn SVN====
This was already mentioned in introduction. Good knowledge of SVN will help to avoid many problems. 

==Building a Game==

===Test installation===

===Updating===
This is second SVN command to deal when wortking with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.</text>
    </revision>
    <revision>
      <id>2368</id>
      <timestamp>2012-08-01T13:51:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Getting a working copy */</comment>
      <text xml:space="preserve" bytes="4327">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Introduction==
Blood Omnicide repository stores all files needed for the development process of Blood Omnicide. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

===Getting a working copy===
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 Wrong:
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 Correct:
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

===Looking around===
When download will be completed, you will see such folders in repository:

* '''bin32''' - game binaries for x86 platform
* '''devkit''' - game sourcecodes and tools
* '''kain''' - gamedir, all of Blood Omnicide files (textures, maps, scripts etc.)
* '''kain_make''' - installation scripts and scripts to make installer
* '''mapeditor''' - level editor
* '''misc''' - help files, icons, map shots etc.

==Key Concepts==

===Development vs Release===
Blood Omnicide version that will be released is different from what you get in repository. Basically, in released version all development-related files are removed (except from ones leaved for SDK), all textures is compressed to [[DDS]] files and all game files are packed into the [[PK3]] archives in order to save HDD space and raise loading time. With all of this operations, 'builded' version fo the game weights about 800Mb.

===Linked to Blood Omen===
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. Installation of Blood Omen files are done when Blood Omnicide builded version is being installed on a computer. Development version doesnt have such installer, but it have a test installation scripts, which does the same job. This is called test installation.  

===Sources are saved===
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources:''' Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources:''' This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

===Conventions===
A number of rules that should be followed in order to keep repository clean.

'''Files names:''' All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits:''' Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, event if it was deleted. So abusing it with many unused files will waste HDD space.

====Learn SVN====
This was already mentioned in introduction. Good knowledge of SVN will help to avoid many problems. 

==Building a Game==

===Test installation===

===Updating===
This is second SVN command to deal when wortking with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.</text>
    </revision>
    <revision>
      <id>2369</id>
      <timestamp>2012-08-01T13:53:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="4342">{{unfinished}}
{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Introduction==
Blood Omnicide repository stores all files needed for the development process of Blood Omnicide. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

===Getting a working copy===
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 Wrong:
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 Correct:
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

===Looking around===
When download will be completed, you will see such folders in repository:

* '''bin32''' - game binaries for x86 platform
* '''devkit''' - game sourcecodes and tools
* '''kain''' - gamedir, all of Blood Omnicide files (textures, maps, scripts etc.)
* '''kain_make''' - installation scripts and scripts to make installer
* '''mapeditor''' - level editor
* '''misc''' - help files, icons, map shots etc.

==Key Concepts==

===Development vs Release===
Blood Omnicide version that will be released is different from what you get in repository. Basically, in released version all development-related files are removed (except from ones leaved for SDK), all textures is compressed to [[DDS]] files and all game files are packed into the [[PK3]] archives in order to save HDD space and raise loading time. With all of this operations, 'builded' version fo the game weights about 800Mb.

===Linked to Blood Omen===
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. Installation of Blood Omen files are done when Blood Omnicide builded version is being installed on a computer. Development version doesnt have such installer, but it have a test installation scripts, which does the same job. This is called test installation.  

===Sources are saved===
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources:''' Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources:''' This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

===Conventions===
A number of rules that should be followed in order to keep repository clean.

'''Files names:''' All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits:''' Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, event if it was deleted. So abusing it with many unused files will waste HDD space.

====Learn SVN====
This was already mentioned in introduction. Good knowledge of SVN will help to avoid many problems. 

==Building a Game==

===Test installation===

===Updating===
This is second SVN command to deal when wortking with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.</text>
    </revision>
    <revision>
      <id>2542</id>
      <timestamp>2012-08-09T14:21:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="489">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

== Chapters ==
&lt;font size=3&gt;
* [[Repository Reference/Introduction|Introduction]]
* [[Repository Reference/Key Concepts|Key Concepts]]
* [[Repository Reference/Building a Game|Building a Game]]
* [[Repository Reference/Naming conventions|Naming conventions]]
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automations|Automations]]
&lt;/font&gt;</text>
    </revision>
    <revision>
      <id>2557</id>
      <timestamp>2012-08-09T14:47:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="515">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Chapters==
&lt;font size=3&gt;
* [[Repository Reference/Introduction|Introduction]]
* [[Repository Reference/Key Concepts|Key Concepts]]
* [[Repository Reference/Building a Game|Building a Game]]
* [[Repository Reference/Naming conventions|Naming conventions]]

==Appendix==
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;</text>
    </revision>
    <revision>
      <id>2559</id>
      <timestamp>2012-08-09T14:48:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="515">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Chapters==
&lt;font size=3&gt;
* [[Repository Reference/Introduction|Introduction]]
* [[Repository Reference/Key Concepts|Key Concepts]]
* [[Repository Reference/Building a Game|Building a Game]]
* [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendix==
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]</text>
    </revision>
    <revision>
      <id>2564</id>
      <timestamp>2012-08-09T14:51:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="537">{{WIP}}
This reference explains a structure of Blood Omnicide SVN repository.

==Chapters==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduction]]
# [[Repository Reference/Key Concepts|Key Concepts]]
# [[Repository Reference/Building a Game|Building a Game]]
# [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendix==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;</text>
    </revision>
    <revision>
      <id>2627</id>
      <timestamp>2012-08-09T20:33:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="555">{{grammar}}
This reference explains a structure of Blood Omnicide SVN repository.

==Chapters==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduction]]
# [[Repository Reference/Key Concepts|Key Concepts]]
# [[Repository Reference/Building a Game|Building a Game]]
# [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendix==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;

{{finished}}</text>
    </revision>
    <revision>
      <id>2712</id>
      <timestamp>2012-09-28T13:49:40Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="569">{{grammar checked|darth}}
This reference explains a structure of Blood Omnicide SVN repository.

==Chapters==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduction]]
# [[Repository Reference/Key Concepts|Key Concepts]]
# [[Repository Reference/Building a Game|Building a Game]]
# [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendix==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;

{{finished}}</text>
    </revision>
    <revision>
      <id>3393</id>
      <timestamp>2013-01-22T12:22:41Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="639">{{grammar checked|darth}}
Questa guida spiega  la struttura del repositorio di SVN utilizzato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduction]]
# [[Repository Reference/Key Concepts|Key Concepts]]
# [[Repository Reference/Building a Game|Building a Game]]
# [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;

{{initalian|Funzionamento del repositorio di SVN}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3394</id>
      <timestamp>2013-01-22T12:23:57Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="665">{{grammar checked|darth}}
Questa guida spiega  la struttura del repositorio di SVN utilizzato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduzione]]
# [[Repository Reference/Key Concepts|Concetti chiave]]
# [[Repository Reference/Building a Game|Costruire il gioco]]
# [[Repository Reference/Naming conventions|Convenzioni per i nomi]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Struttura del repositorio nel dettaglio‎]]
* [[Repository Reference/Automation scripts|Script per l'automazione]]
&lt;/font&gt;

{{initalian|Funzionamento del repositorio di SVN}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3395</id>
      <timestamp>2013-01-22T12:27:21Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Undo revision 3394 by [[Special:Contributions/Lofo1993|Lofo1993]] ([[User talk:Lofo1993|talk]])</comment>
      <text xml:space="preserve" bytes="639">{{grammar checked|darth}}
Questa guida spiega  la struttura del repositorio di SVN utilizzato per Blood Omnicide.

==Capitoli==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduction]]
# [[Repository Reference/Key Concepts|Key Concepts]]
# [[Repository Reference/Building a Game|Building a Game]]
# [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendici==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;

{{initalian|Funzionamento del repositorio di SVN}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3396</id>
      <timestamp>2013-01-22T12:28:01Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>Undo revision 3393 by [[Special:Contributions/Lofo1993|Lofo1993]] ([[User talk:Lofo1993|talk]])</comment>
      <text xml:space="preserve" bytes="569">{{grammar checked|darth}}
This reference explains a structure of Blood Omnicide SVN repository.

==Chapters==
&lt;font size=3&gt;
# [[Repository Reference/Introduction|Introduction]]
# [[Repository Reference/Key Concepts|Key Concepts]]
# [[Repository Reference/Building a Game|Building a Game]]
# [[Repository Reference/Naming conventions|Naming conventions]]
&lt;/font&gt;

==Appendix==
&lt;font size=3&gt;
* [[Repository Reference/Repository structure in-depth‎|Repository structure in-depth‎]]
* [[Repository Reference/Automation scripts|Automation scripts]]
&lt;/font&gt;

{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference/Automation scripts</title>
    <ns>0</ns>
    <id>250</id>
      <sha1>5fgl8skj784avv3tq5zzpta9jwm1ixs</sha1>
    <revision>
      <id>2536</id>
      <timestamp>2012-08-09T14:15:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Repository structure in depth}} Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions...&quot;</comment>
      <text xml:space="preserve" bytes="2460">{{navigation title|Repository structure in depth}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[#Building a game]] is one of big automation scripts you already know about. This chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Script to build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Script to build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Script to build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2537</id>
      <timestamp>2012-08-09T14:15:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2460">{{navigation title|Repository structure in-depth}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[#Building a game]] is one of big automation scripts you already know about. This chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Script to build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Script to build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Script to build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2539</id>
      <timestamp>2012-08-09T14:17:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2430">{{navigation title|Repository structure in-depth}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[#Building a game]] is one of big automation scripts you already know about. This chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2540</id>
      <timestamp>2012-08-09T14:18:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2474">{{navigation title|Repository structure in-depth}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of big automation scripts you already know about. This chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2555</id>
      <timestamp>2012-08-09T14:46:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2445">{{navigation title|}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of big automation scripts you already know about. This chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2556</id>
      <timestamp>2012-08-09T14:46:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Repository Reference/Automations]] to [[Repository Reference/Automation scripts]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="2445">{{navigation title|}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of big automation scripts you already know about. This chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2615</id>
      <timestamp>2012-08-09T20:20:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2453">{{navigation title|}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of big automation script you already know about. This appendix chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2616</id>
      <timestamp>2012-08-09T20:21:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2478">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier with making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of big automation script you already know about. This appendix chapter list other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts is located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are automatically generated. It is using about 20 terrain textures (rock, grass, ground etc.) and materials having all combinations (rock-grass, grass-ground, grass-rock etc.)

All available terrain textures is listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/ textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2780</id>
      <timestamp>2012-10-11T14:22:26Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="2469">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generates radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generates terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. When new material scripts is added, this files should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2781</id>
      <timestamp>2012-10-11T14:23:18Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Build shaderlist.txt */</comment>
      <text xml:space="preserve" bytes="2473">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generates radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generates terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. Whenever new material scripts are added, this file should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2782</id>
      <timestamp>2012-10-11T14:23:38Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Build terrain materials */</comment>
      <text xml:space="preserve" bytes="2471">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. Whenever new material scripts are added, this file should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesnt know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in texture window. Which is incorrect. To prevent that a special material file is maked for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures get added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2783</id>
      <timestamp>2012-10-11T14:26:30Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Build skip shaders */</comment>
      <text xml:space="preserve" bytes="2475">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. Whenever new material scripts are added, this file should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesn't know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in the texture window, which is incorrect. To prevent that a special material file is made for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures are added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps is created to help with publishing new Bloody Sounds tracks. They are pretty simple. All scripts is located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2784</id>
      <timestamp>2012-10-11T14:27:16Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Music automation */</comment>
      <text xml:space="preserve" bytes="2472">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. Whenever new material scripts are added, this file should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesn't know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in the texture window, which is incorrect. To prevent that a special material file is made for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures are added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps are created to help publishing new Bloody Sounds tracks. They are pretty simple. All scripts are located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There is many of temp files created during compilation. This files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2785</id>
      <timestamp>2012-10-11T14:27:54Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Map automation */</comment>
      <text xml:space="preserve" bytes="2476">{{navigation title|}}
{{grammar}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. Whenever new material scripts are added, this file should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesn't know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in the texture window, which is incorrect. To prevent that a special material file is made for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures are added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps are created to help publishing new Bloody Sounds tracks. They are pretty simple. All scripts are located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There are many temporary files created during compilation. These files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2786</id>
      <timestamp>2012-10-11T14:28:11Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="2490">{{navigation title|}}
{{grammar checked|darth}}
Blood Omnicide repository contains a number of automation scripts used to make life easier by making some repeated actions. [[Repository Reference/Building a Game|Building a game chapter]] is one of the big automation scripts you already know about. This appendix chapter lists other automation scripts.

==Materials automation==
Various scripts to help with materials, all scripts are located in '''kain/scripts/automation/'''

===Build terrain materials===
Terrain materials in Blood Omnicide are already generated using about 20 terrain textures (rock, grass, ground etc.) and all combinations of materials (rock-grass, grass-ground, grass-rock etc.).

All available terrain textures are listed in '''kain/scripts/terraintypes.txt'''

* '''make_terrain_pics.cmd''': generate radiant/textures for materials (you need ImageMagick 6.6.7 Q8 installed in C:\Program Files (x86)\ImageMagick-6.6.7-Q8)
* '''make_terrain_shaders.cmd''': generate terrain textures_terrain.shader

===Build shaderlist.txt===
File scripts/shaderlist.txt is used by map compiler and level editor to load .shader files. Whenever new material scripts are added, this file should be re-generated.

* '''make_shaderlist.cmd''': generate shaderlist.txt

===Build skip shaders===
Level editor is dumb, it doesn't know what a normalmap is. So it shows normalmaps, specular textures, and all other additional textures in the texture window, which is incorrect. To prevent that a special material file is made for level editor that flags all this textures as skipped. This script must be executed each time new normalmaps, specular and other additional textures are added.

* '''make_shaders_skip.cmd''': generate radiant/scripts/skip.shader

==Music automation==
Music automation scritps are created to help publishing new Bloody Sounds tracks. They are pretty simple. All scripts are located in '''kain\music\automation'''.

* '''make_files.bat''': make Bloody Sounds .mp3 files and ZIP containing all OGG files
* '''make_html.bat''': make HTML code for Bloody Sounds page (russian)
* '''make_html_en.bat''': make HTML code for Bloody Sounds page (english)

==Map automation==
There are many temporary files created during compilation. These files are: .prt, .srf, .autosave.map, .bad, .log, .pts.

'''kain/maps/cleanup.bat''': remove all temporary files 

{{important|This script will remove all autosaves created for maps. Be careful!}}

{{navigation footer|}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference/Building a Game</title>
    <ns>0</ns>
    <id>247</id>
      <sha1>9ihp3mjm3jxigdqy0h60sqb3b2l7rfx</sha1>
    <revision>
      <id>2532</id>
      <timestamp>2012-08-09T14:09:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Building a Game}} ==Test installation== Test installation will turn downloaded repository into the working game. Test installation does exactly same things ...&quot;</comment>
      <text xml:space="preserve" bytes="2089">{{navigation title|Building a Game}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (either PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# Get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
This is second SVN command to deal when working with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

{{important|Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.}}

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD smace and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while compressed only requires 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2541</id>
      <timestamp>2012-08-09T14:18:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2092">{{navigation title|Naming conventions}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (either PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# Get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
This is second SVN command to deal when working with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

{{important|Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.}}

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD smace and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while compressed only requires 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2543</id>
      <timestamp>2012-08-09T14:22:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2086">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (either PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# Get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
This is second SVN command to deal when working with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

{{important|Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.}}

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD smace and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while compressed only requires 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2545</id>
      <timestamp>2012-08-09T14:24:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>fixes</comment>
      <text xml:space="preserve" bytes="2079">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# Get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
This is second SVN command to deal when working with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

{{important|Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.}}

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD smace and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while compressed only requires 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2546</id>
      <timestamp>2012-08-09T14:24:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Test installation */</comment>
      <text xml:space="preserve" bytes="2079">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
This is second SVN command to deal when working with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

{{important|Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.}}

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD smace and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while compressed only requires 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2547</id>
      <timestamp>2012-08-09T14:25:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Textures DDS cache */</comment>
      <text xml:space="preserve" bytes="2084">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
This is second SVN command to deal when working with Blood Omnicide subversion. Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

{{important|Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.}}

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD space and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2597</id>
      <timestamp>2012-08-09T19:05:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Updating */</comment>
      <text xml:space="preserve" bytes="1990">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. This is done for both saving HDD space and for lower VRAM requirements (Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM).

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2598</id>
      <timestamp>2012-08-09T19:15:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Textures DDS cache */</comment>
      <text xml:space="preserve" bytes="1983">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them of got updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild DDS cache.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2599</id>
      <timestamp>2012-08-09T19:16:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Textures DDS cache */</comment>
      <text xml:space="preserve" bytes="1980">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2600</id>
      <timestamp>2012-08-09T19:16:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Test installation */</comment>
      <text xml:space="preserve" bytes="1982">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG format and copy it to kain_make/installscript/kain_psx/kain.img
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo/'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2628</id>
      <timestamp>2012-08-09T20:57:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2126">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG or BIN format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2629</id>
      <timestamp>2012-08-09T21:03:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2271">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
:{{important|To proceed with PlayStation installation, make sure you have [http://www.java.com/en/download/index.jsp Java Runtimes] installed.}}
# get a image of Blood Omen CD in IMG or BIN format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2630</id>
      <timestamp>2012-08-09T21:12:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Test installation */</comment>
      <text xml:space="preserve" bytes="2269">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
:{{important|To proceed with PlayStation installation, make sure you have [http://www.java.com/en/download/manual_v6.jsp Java v6] installed.}}
# get a image of Blood Omen CD in IMG or BIN format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# copy '''pill.big''' from Kain Sneak Peek Preview to '''kain_make/installscript/kain_demo/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>2631</id>
      <timestamp>2012-08-09T21:19:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Test installation */</comment>
      <text xml:space="preserve" bytes="2135">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game. Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
:{{important|To proceed with PlayStation installation, make sure you have [http://www.java.com/en/download/manual_v6.jsp Java v6] installed.}}
# get a image of Blood Omen CD in IMG or BIN format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>3334</id>
      <timestamp>2012-12-13T11:11:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2157">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game (a developer version). Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
:{{important|To proceed with PlayStation installation, make sure you have [http://www.java.com/en/download/manual_v6.jsp Java v6] installed.}}
# get a image of Blood Omen CD in IMG or BIN format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
'''Blood Omen Demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>3336</id>
      <timestamp>2012-12-22T20:58:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Test installation */</comment>
      <text xml:space="preserve" bytes="2296">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game (a developer version). Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
:{{important|To proceed with PlayStation installation, make sure you have [http://www.java.com/en/download/manual_v6.jsp Java v6] installed.}}
# get a image of Blood Omen CD in IMG or BIN format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
:{{tip|For proper handling of CD image files, all attribute files created with image file (.ccd, cue, .sub) should be available as well.}}
'''Blood Omen Demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>3337</id>
      <timestamp>2012-12-23T10:39:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2390">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game (a developer version). Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

'''Blood Omen PC Version'''
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
'''Blood Omen PlayStation'''
# get a image of Blood Omen CD in IMG/BIN/ISO/MDF format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin, kain.iso, kain.mdf). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
:{{important|For proper handling of CD image files, all attribute files created with image file (.ccd, cue, .sub) should be available as well.}}
:{{tip|Only valid disk images are supported. There is some user-made translations which may work with PSX emulator, but is not working with install script because jPSXDec unable to extract index for them}}
'''Blood Omen Demo'''
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>3338</id>
      <timestamp>2012-12-23T10:50:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2768">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game (a developer version). Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

&lt;h4&gt;1.Blood Omen PC Version&lt;/h4&gt;
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
&lt;h4&gt;2. Blood Omen PlayStation&lt;/h4&gt;
# get a image of Blood Omen CD in IMG/BIN/ISO/MDF format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin, kain.iso, kain.mdf). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
:{{important|For proper handling of CD image files, all attribute files created with image file (.ccd, cue, .sub) should be available as well.}}
:{{important|Only valid disk images are supported. There is some user-made translations which may work with PSX emulator, but is not working with install script.}}
&lt;h4&gt;3. Blood Omen PlayStation (custom)&lt;/h4&gt;
This installation script is only provided as last resort when using bogus CD image (which failed to install with generic script). It have no support for FMV's.
# mount image file with Alcohol 52%, Daemon Tools or any other tool
# copy kain/pill.big into kain_make/installscript/psx/pill.big
# run kain_make/installscript/run_installationscript_psx_custom.cmd
&lt;h4&gt;4. Blood Omen Demo&lt;/h4&gt;
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>3339</id>
      <timestamp>2012-12-23T12:54:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2773">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game (a developer version). Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

&lt;h4&gt;1.Blood Omen PC Version&lt;/h4&gt;
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
&lt;h4&gt;2. Blood Omen PlayStation&lt;/h4&gt;
# get a image of Blood Omen CD in IMG/BIN/ISO/MDF format and copy it to '''kain_make/installscript/kain_psx/kain.img''' (or kain.bin, kain.iso, kain.mdf). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
:{{important|For proper handling of CD image files, all attribute files created with image file (.ccd, cue, .sub) should be available as well.}}
:{{important|Only valid disk images are supported. There is some user-made translations which may work with PSX emulator, but is not working with install script.}}
&lt;h4&gt;3. Blood Omen PlayStation (custom)&lt;/h4&gt;
This installation script is only provided as last resort when using bogus CD image (which failed to install with generic script). It have no support for FMV's.
# mount image file with Alcohol 52%, Daemon Tools or any other tool
# copy kain/pill.big into kain_make/installscript/kain_psx/pill.big
# run kain_make/installscript/run_installationscript_psx_custom.cmd
&lt;h4&gt;4. Blood Omen Demo&lt;/h4&gt;
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
    <revision>
      <id>3340</id>
      <timestamp>2012-12-23T12:56:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2780">{{navigation title|Key Concepts}}
==Test installation==
Test installation will turn downloaded repository into the working game (a developer version). Test installation does exactly same things as real installation of Blood Omnicide. For each version of the game (PC, PlayStation, Demo) installation procedure is slightly different.

&lt;h4&gt;1.Blood Omen PC Version&lt;/h4&gt;
# copy '''pill.big''' and all '''.jam'''/'''.vag''' files into '''kain_make/installscript/kain/'''. If directory is not there, create it.
# run kain_make/installscript/run_installationscript.cmd
&lt;h4&gt;2. Blood Omen PlayStation&lt;/h4&gt;
# get a image of Blood Omen CD in BIN/MDF/ISO/IMG format and copy it to '''kain_make/installscript/kain_psx/kain.bin''' (or kain.mdf, kain.iso, kain.img). If directory is not there, create it.
# run kain_make/installscript/run_installationscript_psx.cmd
:{{important|For proper handling of CD image files, all attribute files created with image file (.ccd, .cue, .sub, .mds) should be available as well.}}
:{{important|Only valid disk images are supported. There is some user-made translations which may work with PSX emulator, but is not working with install script.}}
&lt;h4&gt;3. Blood Omen PlayStation (custom)&lt;/h4&gt;
This installation script is only provided as last resort when using bogus CD image (which failed to install with generic script). It have no support for FMV's.
# mount image file with Alcohol 52%, Daemon Tools or any other tool
# copy kain/pill.big into kain_make/installscript/kain_psx/pill.big
# run kain_make/installscript/run_installationscript_psx_custom.cmd
&lt;h4&gt;4. Blood Omen Demo&lt;/h4&gt;
# run kain_make/installscript/run_installationscript_demo.cmd

==Updating==
Launch '''svn update''' command regularly to get all latest changes on repository made by other users.

Some updates bring the changes into the file structure (adding new monsters, renaming files). In this case '''test installations''' needs to be run once again. Check log for a message after updating you need to run test installation script.

==Textures DDS cache==
Release version of the game contain all textures compressed in DDS format. DDS cache helps saving HDD space and lowering VRAM requirements.

Blood Omnicide with 32-bit textures requires videocard with 1GB VRAM, while with compressed textures only 256MB VRAM.

To build DDS cache for all textures run '''kain_make/makedds/makedds_textures.bat'''.

{{important|Once using DDS cache, engine will skip ALL [[TGA]] textures, so if you are testing changes with them or got svn updates, be sure to remove '''kain/PILL500.PK3''' (a file containing generated DDS cache) or rebuild it.}}
{{tip|Setting cvar '''r_texture_dds_load''' to 0 will disable DDS cache, but for all things including sprites.}}

{{navigation footer|Naming conventions}}</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference/Introduction</title>
    <ns>0</ns>
    <id>245</id>
      <sha1>jub39s0i8wldp4946xybt7jgnft9r0z</sha1>
    <revision>
      <id>2529</id>
      <timestamp>2012-08-09T14:05:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|}} Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful...&quot;</comment>
      <text xml:space="preserve" bytes="2306">{{navigation title|}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 Wrong:
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 Correct:
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see such folders in repository:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to make installer.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| portable level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2530</id>
      <timestamp>2012-08-09T14:05:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2296">{{navigation title|}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 Wrong:
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 Correct:
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see such folders in repository:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to make installer.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| portable level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2585</id>
      <timestamp>2012-08-09T15:38:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Getting a working copy */</comment>
      <text xml:space="preserve" bytes="2350">{{navigation title|}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see such folders in repository:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to make installer.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| portable level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2586</id>
      <timestamp>2012-08-09T15:39:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Looking around */</comment>
      <text xml:space="preserve" bytes="2369">{{navigation title|}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see such folders in repository:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| portable level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2587</id>
      <timestamp>2012-08-09T15:39:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Looking around */</comment>
      <text xml:space="preserve" bytes="2360">{{navigation title|}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see such folders in repository:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2590</id>
      <timestamp>2012-08-09T18:56:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Looking around */</comment>
      <text xml:space="preserve" bytes="2759">{{navigation title|}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (have raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}</text>
    </revision>
    <revision>
      <id>2626</id>
      <timestamp>2012-08-09T20:33:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2784">{{navigation title|}}
{{grammar}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier with working on various aspects of the game. Blood Omnicide repository stores project at it's very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems work and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] are recommended one). For executing '''svn checkout''' command you are only need to get repository address, password are not required.
{{Important|Make sure path to working copy folder is nice and doesnt contain non-lating characters and whitespaces:}}
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (have raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2791</id>
      <timestamp>2012-10-11T14:41:36Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="2772">{{navigation title|}}
{{grammar}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier when working on various aspects of the game. Blood Omnicide repository stores project at its very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems works and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] is recommended). For executing '''svn checkout''' command you only need to get repository address, password is not required.
{{Important|Make sure path to working copy folder is nice and doesn't contain non-latin characters and whitespaces:}}
 &lt;font color=red&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (have raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2792</id>
      <timestamp>2012-10-11T14:42:41Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Looking around */</comment>
      <text xml:space="preserve" bytes="2771">{{navigation title|}}
{{grammar}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier when working on various aspects of the game. Blood Omnicide repository stores project at its very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems works and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] is recommended). For executing '''svn checkout''' command you only need to get repository address, password is not required.
{{Important|Make sure path to working copy folder is nice and doesn't contain non-latin characters and whitespaces:}}
 &lt;font color=red&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (has raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2793</id>
      <timestamp>2012-10-11T14:43:10Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="2785">{{navigation title|}}
{{grammar checked|darth}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier when working on various aspects of the game. Blood Omnicide repository stores project at its very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems works and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] is recommended). For executing '''svn checkout''' command you only need to get repository address, password is not required.
{{Important|Make sure path to working copy folder is nice and doesn't contain non-latin characters and whitespaces:}}
 &lt;font color=red&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (has raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3632</id>
      <timestamp>2013-04-04T19:59:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Looking around */</comment>
      <text xml:space="preserve" bytes="2900">{{navigation title|}}
{{grammar checked|darth}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier when working on various aspects of the game. Blood Omnicide repository stores project at its very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems works and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] is recommended). For executing '''svn checkout''' command you only need to get repository address, password is not required.
{{Important|Make sure path to working copy folder is nice and doesn't contain non-latin characters and whitespaces:}}
 &lt;font color=red&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 3GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_dlc'''
| gamedir storing additional downloadable content.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (has raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3662</id>
      <timestamp>2013-09-01T12:31:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Getting a working copy */</comment>
      <text xml:space="preserve" bytes="3273">{{navigation title|}}
{{grammar checked|darth}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier when working on various aspects of the game. Blood Omnicide repository stores project at its very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems works and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] is recommended). For executing '''svn checkout''' command you only need to get repository address, password is not required.
{{Important|Make sure path to working copy folder is nice and doesn't contain non-latin characters and whitespaces:}}
 &lt;font color=red&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 4GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Important|By default checkout will download all stuff of svn, including base game and optional DLC packages. In order to reduce download size you can exclude '''kain_dlc''' folder from being downloaded by pressing &quot;Choose items...&quot; button in &quot;Checkout Depth&quot; group of Checkout window. Also you can exclude &quot;misc&quot; and &quot;devkit&quot; folder if you only planning to test stuff.}}
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_dlc'''
| gamedir storing additional downloadable content.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (has raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3663</id>
      <timestamp>2013-09-01T12:33:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Getting a working copy */</comment>
      <text xml:space="preserve" bytes="3359">{{navigation title|}}
{{grammar checked|darth}}
Blood Omnicide repository stores all files needed for the development process. It contains game files, media, sourcecodes, useful tools and other helpful stuff that makes life easier when working on various aspects of the game. Blood Omnicide repository stores project at its very latest development state and all previous versions.

Before you start working with Blood Omnicide repository, be sure to learn how version control systems works and particulary [http://en.wikipedia.org/wiki/Apache_Subversion subversion].

==Getting a working copy==
This is actually first step on work with Blood Omnicide repository - get a working copy of the repository.

Install SVN client (for Windows [http://tortoisesvn.net/ TortoiseSVN] is recommended). For executing '''svn checkout''' command you only need to get repository address, password is not required.
{{Important|Make sure path to working copy folder is nice and doesn't contain non-latin characters and whitespaces:}}
 &lt;font color=red&gt;// Wrong&lt;/font&gt;
 c:\Documents and Settings\Администратор\Desktop\Blood Omnicide Repository
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 c:\OmnicideSVN

Downloading full working copy takes about 4GB of bandwidth. Downloaded working copy takes about 10GB, make sure you have at least double of that as it will grow up with time.
{{Important|By default checkout will download all stuff of svn, including base game and optional DLC packages. In order to reduce download size you can exclude '''kain_dlc''' folder from being downloaded by pressing &quot;Choose items...&quot; button in &quot;Checkout Depth&quot; group of Checkout window. Also you can exclude &quot;misc&quot; and &quot;devkit&quot; folder if you only planning to test stuff. If you are updating SVN, you can set the checkout depth in &quot;Update to Revision&quot; menu.}}
{{Tip|Download can be stopped and resumed at any time}}

==Looking around==
Once download is completed, you will see:

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin32'''
| game binaries for x86 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bin64'''
| game binaries for x64 platform
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''devkit'''
| game sourcecodes and tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain'''
| gamedir storing all of Blood Omnicide files (textures, maps, scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_make'''
| installation scripts and scripts to build release version of the game.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''kain_dlc'''
| gamedir storing additional downloadable content.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapeditor'''
| level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| help files, icons, map shots etc.
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''gpl.txt'''
| GNU GPL v2 license
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''launch.exe'''
| Blood Omnicide launcher
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide.exe'''
| Blood Omnicide game executable
|-
| [[File:Icon omnicide.png|16px|alt=|link=]] 
| '''omnicide-dev.exe'''
| Blood Omnicide development-only executable (has raised entity limits)
|}
&lt;/div&gt;

{{navigation footer|Key Concepts}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference/Key Concepts</title>
    <ns>0</ns>
    <id>246</id>
      <sha1>88q9p2bmeryp973elqkaygmmujpoaba</sha1>
    <revision>
      <id>2531</id>
      <timestamp>2012-08-09T14:08:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Introduction}}  ==Development vs Release== Blood Omnicide version that will be released is different from what you get in repository. Basically, in released...&quot;</comment>
      <text xml:space="preserve" bytes="2149">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide version that will be released is different from what you get in repository. Basically, in released version all development-related files are removed (except from ones leaved for SDK), all textures is compressed to [[DDS]] files and all game files are packed into the [[PK3]] archives in order to save HDD space and raise loading time. With all of this operations, 'builded' version fo the game weights about 800Mb.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. Installation of Blood Omen files are done when Blood Omnicide builded version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. It is called '''test installation'''.  

==Sources are saved==
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2591</id>
      <timestamp>2012-08-09T19:01:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development vs Release */</comment>
      <text xml:space="preserve" bytes="2257">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. Installation of Blood Omen files are done when Blood Omnicide builded version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. It is called '''test installation'''.  

==Sources are saved==
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2592</id>
      <timestamp>2012-08-09T19:02:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Linked to Blood Omen */</comment>
      <text xml:space="preserve" bytes="2310">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Installation of Blood Omen files are done when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2593</id>
      <timestamp>2012-08-09T19:03:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Linked to Blood Omen */</comment>
      <text xml:space="preserve" bytes="2296">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media files sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2594</id>
      <timestamp>2012-08-09T19:03:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Sources are saved */</comment>
      <text xml:space="preserve" bytes="2295">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason source files dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2595</id>
      <timestamp>2012-08-09T19:04:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sources are saved */</comment>
      <text xml:space="preserve" bytes="2299">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variation. For static models its best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2596</id>
      <timestamp>2012-08-09T19:04:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Sources are saved */</comment>
      <text xml:space="preserve" bytes="2302">{{navigation title|Introduction}}

==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}</text>
    </revision>
    <revision>
      <id>2625</id>
      <timestamp>2012-08-09T20:32:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2326">{{navigation title|Introduction}}
{{grammar}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* options compressed textures (DDS Cache)
* Uncompressed textures
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and developent files deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2649</id>
      <timestamp>2012-09-08T17:09:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Development vs Release */</comment>
      <text xml:space="preserve" bytes="2320">{{navigation title|Introduction}}
{{grammar}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* All textures is Uncompressed, DDS Cache are optional
* Sources and development files
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and development files are deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2650</id>
      <timestamp>2012-09-08T17:10:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Development vs Release */</comment>
      <text xml:space="preserve" bytes="2329">{{navigation title|Introduction}}
{{grammar}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* All textures is Uncompressed, DDS Cache are optional
* Sources and development files included
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and development files are deleted
* SDK in separate download

Release version fo the game weights about 800Mb and have lesser loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2787</id>
      <timestamp>2012-10-11T14:32:38Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Development vs Release */</comment>
      <text xml:space="preserve" bytes="2326">{{navigation title|Introduction}}
{{grammar}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* All textures are uncompressed, DDS cache is optional
* Sources and development files included
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and development files are deleted
* SDK in separate download

Release version for the game is about 800 Mb and has shorter loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you dont get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesnt have such installer, but it have a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2788</id>
      <timestamp>2012-10-11T14:34:42Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Linked to Blood Omen */</comment>
      <text xml:space="preserve" bytes="2327">{{navigation title|Introduction}}
{{grammar}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* All textures are uncompressed, DDS cache is optional
* Sources and development files included
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and development files are deleted
* SDK in separate download

Release version for the game is about 800 Mb and has shorter loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you don't get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesn't have such installer, but it has a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason some source file dont get saved, is when it's size are too big (&gt;100Mb). Sources are saved in the same folder as their exported files. The code sources doesnt need an futher explanation, but textures and models apparently are:

'''Texture sources'''
:Source are the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:This have alot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2789</id>
      <timestamp>2012-10-11T14:36:53Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Sources are saved */</comment>
      <text xml:space="preserve" bytes="2321">{{navigation title|Introduction}}
{{grammar}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* All textures are uncompressed, DDS cache is optional
* Sources and development files included
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and development files are deleted
* SDK in separate download

Release version for the game is about 800 Mb and has shorter loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you don't get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesn't have such installer, but it has a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason a source file doesn't get saved is when its size is too big (&gt;100Mb). Sources are saved in the same folder as the exported files. The code sources don't need a further explanation, but textures and models apparently do:

'''Texture sources'''
:Source is the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:These have a lot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2790</id>
      <timestamp>2012-10-11T14:37:39Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="2335">{{navigation title|Introduction}}
{{grammar checked|darth}}
==Development vs Release==
Blood Omnicide release version is different from what you get in repository. 

For development version:
* All files are real files (except for test installation)
* All textures are uncompressed, DDS cache is optional
* Sources and development files included
* SDK and tools included

In release version:
* All files packed into game archives
* Textures are compressed (DDS cache only)
* Source files and development files are deleted
* SDK in separate download

Release version for the game is about 800 Mb and has shorter loading times.

==Linked to Blood Omen==
By just downloading a working copy of repository you don't get a working game. Since Blood Omnicide is a port, it heavily depends on original game media files. 

Blood Omen files got copied when Blood Omnicide release version is being installed on a computer. Development version doesn't have such installer, but it has a '''test installation script''' that does the same job. The process of getting a working copy of Blood Omnicide is called '''test installation'''.

==Sources are saved==
All media file sources get saved to SVN, including source files for tools, textures and models. The only reason a source file doesn't get saved is when its size is too big (&gt;100Mb). Sources are saved in the same folder as the exported files. The code sources don't need a further explanation, but textures and models apparently do:

'''Texture sources'''
:Source is the base image (PSD or whatever) you are exporting to [[TGA]] texture.

'''Model sources'''
:These have a lot of variations. For static models it is best to save sources as [[ASE]] files, if models are animated, store whatever source file you have (MAX, blend etc.)

==Common conventions==
A number of rules that should be followed in order to keep repository clean.

'''Files names'''
:All files, folders, file extensions must be lowercase with all-latin characters and with no spacers. Failing this rule can throw a number of problems like limited portability and SVN errors.

'''Commits'''
:Dont commit files no one will use. SVN is not a light version of FTP. It stores all file versions, even if it was deleted. So abusing it with many unused files will waste HDD space.

{{navigation footer|Building a Game}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference/Naming conventions</title>
    <ns>0</ns>
    <id>248</id>
      <sha1>s1psc7w0b8y2lcrs1618qj2m19hrivx</sha1>
    <revision>
      <id>2533</id>
      <timestamp>2012-08-09T14:12:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Building a Game}} ==Texture names== Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this t...&quot;</comment>
      <text xml:space="preserve" bytes="2834">{{navigation title|Building a Game}}
==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward slashes (/).

If material is additional variation of a base materia, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
For convenience materials is grouped into different themes, each theme is subfolder of textures/ and separate list item in texture window of map editor.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).
==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard
==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.
==Map props==
All level pros is saved to models/maps/&lt;location_name&gt; folders. Yet again, use same names. For example, name terrain mesh as '''terrain.ase''', not '''02.ase''' or '''terr01b.ase'''.

{{navigation footer|Repository structure in-depth}}</text>
    </revision>
    <revision>
      <id>2548</id>
      <timestamp>2012-08-09T14:33:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3308">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Should use sane names for them. 

Example:

 &lt;font color=green&gt;Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ase'''

{{navigation footer|Repository structure in-depth}}</text>
    </revision>
    <revision>
      <id>2549</id>
      <timestamp>2012-08-09T14:36:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Model names */</comment>
      <text xml:space="preserve" bytes="3460">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Should use sane names for them. 

Example:

 &lt;font color=green&gt;Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ase'''

{{navigation footer|Repository structure in-depth}}</text>
    </revision>
    <revision>
      <id>2550</id>
      <timestamp>2012-08-09T14:37:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map props */</comment>
      <text xml:space="preserve" bytes="3466">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Should use sane names for them. 

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ase'''

{{navigation footer|Repository structure in-depth}}</text>
    </revision>
    <revision>
      <id>2551</id>
      <timestamp>2012-08-09T14:37:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map props */</comment>
      <text xml:space="preserve" bytes="3466">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Should use sane names for them. 

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|Repository structure in-depth}}</text>
    </revision>
    <revision>
      <id>2552</id>
      <timestamp>2012-08-09T14:37:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map props */</comment>
      <text xml:space="preserve" bytes="3474">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|Repository structure in-depth}}</text>
    </revision>
    <revision>
      <id>2558</id>
      <timestamp>2012-08-09T14:47:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3522">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should contain only latin characters, all lowercase. It should have one or two words explaining what this texture is for. Special texture should be suffixed according to skinframe rules (see [[texture]])

If there is several variations of this texture, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1
==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2601</id>
      <timestamp>2012-08-09T19:18:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Texture names */</comment>
      <text xml:space="preserve" bytes="3482">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for. Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

If texture is a part of some group, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

{{tip|Material layers are done with copying a mesh in a model, or with q3map_cloneShader material keyword (this only works for map surfaces)}}

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2602</id>
      <timestamp>2012-08-09T19:19:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Material names */</comment>
      <text xml:space="preserve" bytes="3338">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for. Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

If texture is a part of some group, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme are seen in level editor texture browser. Also it is convenient way to break files into several separate folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2603</id>
      <timestamp>2012-08-09T19:20:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Texture themes */</comment>
      <text xml:space="preserve" bytes="3339">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for. Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

If texture is a part of some group, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in models/mapobjects/. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2604</id>
      <timestamp>2012-08-09T19:21:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Model themes */</comment>
      <text xml:space="preserve" bytes="3345">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for. Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

If texture is a part of some group, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name should contain lowercase latin characters and position of a map in hierarchy:
* '''World''' 
** '''Locations'''
*** '''Sub-locations'''
Template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2
Test levels should be prefixed by '''test-'''. They are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2607</id>
      <timestamp>2012-08-09T19:38:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map names */</comment>
      <text xml:space="preserve" bytes="3340">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for. Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

If texture is a part of some group, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location'''
Name template: '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2608</id>
      <timestamp>2012-08-09T19:38:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map names */</comment>
      <text xml:space="preserve" bytes="3342">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for. Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

If texture is a part of some group, use the following template for naming: '''texturename&lt;group_number&gt;_&lt;texture_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location'''
Name template: 
 '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2609</id>
      <timestamp>2012-08-09T19:40:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Texture names */</comment>
      <text xml:space="preserve" bytes="3286">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for.

Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

Name template:
 '''texturename&lt;group_number&gt;_&lt;variation_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location'''
Name template: 
 '''w'''[''worldnum'']'''m'''[''locationnum'']'''''-'''''[''location_name'']'''-'''[''sub-location_name'']

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2610</id>
      <timestamp>2012-08-09T19:43:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map names */</comment>
      <text xml:space="preserve" bytes="3274">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for.

Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

Name template:
 '''texturename&lt;group_number&gt;_&lt;variation_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location''' (optional)
Name template:
:'''w''&lt;worldnum&gt;''m''&lt;locationnum&gt;''-''&lt;location_name&gt;''-''&lt;sub_location_name&gt;'''''

If sub-location is grouped (there is several crypts, caves etc.) first one doesnt contain 1.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2611</id>
      <timestamp>2012-08-09T19:44:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Map names */</comment>
      <text xml:space="preserve" bytes="3280">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for.

Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

Name template:
 '''texturename&lt;group_number&gt;_&lt;variation_number&gt;'''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location''' (optional)
Name template:
:w''&lt;worldnum&gt;''m''&lt;locationnum&gt;''-''&lt;location_name&gt;''-''&lt;sub_location_name&gt;''

If sub-location is grouped (there is several crypts, caves etc.) first one should not have 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2612</id>
      <timestamp>2012-08-09T19:45:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Texture names */</comment>
      <text xml:space="preserve" bytes="3283">{{navigation title|Building a Game}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for.

Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

Name template:
: texturename''&lt;group_number&gt;''_''&lt;variation_number&gt;''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location''' (optional)
Name template:
:w''&lt;worldnum&gt;''m''&lt;locationnum&gt;''-''&lt;location_name&gt;''-''&lt;sub_location_name&gt;''

If sub-location is grouped (there is several crypts, caves etc.) first one should not have 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2620</id>
      <timestamp>2012-08-09T20:27:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3308">{{navigation title|Building a Game}}
{{Grammar}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for.

Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

Name template:
: texturename''&lt;group_number&gt;''_''&lt;variation_number&gt;''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location''' (optional)
Name template:
:w''&lt;worldnum&gt;''m''&lt;locationnum&gt;''-''&lt;location_name&gt;''-''&lt;sub_location_name&gt;''

If sub-location is grouped (there is several crypts, caves etc.) first one should not have 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2624</id>
      <timestamp>2012-08-09T20:32:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3308">{{navigation title|Building a Game}}
{{grammar}}
Naming conventions are required to keep repository clean and easy to work with. There is some files violating common rules, making them first candidates for the renaming.

Be sure to follow this conventions when adding new files to the repository.

==Texture names==
Texture name should be one or two words explaining what this texture is for.

Special textures (normalmaps, glowmaps etc.) should have suffix according to skinframe rules (see [[texture]])

Name template:
: texturename''&lt;group_number&gt;''_''&lt;variation_number&gt;''

Example:
 textures/towns/brick1_1
 textures/towns/brick1_2
 textures/towns/brick1_3
 textures/towns/brick2_1
 textures/towns/brick2_2
 textures/towns/brick2_3
 textures/towns/brick3_1

==Material names==
Material names should mimic texture names where possible. For portability reasons there should be only forward ('''/''') slashes.

If material is additional variation of a base material, or additional layer of it, it's name should begin as it's base material

Example:
 textures/inn/window &lt;font color=green&gt;// base material&lt;/font&gt;
 textures/inn/window_envmap &lt;font color=green&gt;// additional envmap layer&lt;/font&gt;

==Texture themes==
Texture themes is way to categorize textures in map editor. Only one texture theme can be inspected in texture browser at one time. Also it is convenient way to separate files into several folders.

Texture theme should be one word explaining what it will be (like crypt, mausoleum, inn etc.).

Examples:
 crypt
 mausoleum
 dungeon
 spiritforge
 town

==Model names==
Model names can contain lowercase latin characters, numbers and underscore as spacer. Names should be sane, suffixes and numbers should be added only if model is part of some group.

{{important|Some exporters like a 3D Studio Max ASE exporter always makes file extensions uppercase, should fix this before models get uploaded to repository}}

Examples:
 &lt;font color=green&gt;// Correct&lt;/font&gt;
 models/mapobjects/graveyard/stone1.md3
 models/mapobjects/graveyard/stone2.md3
 models/mapobjects/graveyard/stone3.md3
 models/mapobjects/misc/bat1.md3
 models/mapobjects/misc/bat2.md3
 &lt;font color=green&gt;// Wrong&lt;/font&gt;
 models/mapobjects/my models/barrel.md3
 models/mapobjects/graveyard/stone4.MD3

==Model themes==
Like texture themes, model themes are subfolders in '''models/mapobjects/'''. Model theme name should be one word, explaining what models will be used for.

Examples:
 crypt
 dungeon
 graveyard

==Map names==
Map name contains position of a map location in hierarchy:
* '''World''' 
** '''Location'''
*** '''Sub-location''' (optional)
Name template:
:w''&lt;worldnum&gt;''m''&lt;locationnum&gt;''-''&lt;location_name&gt;''-''&lt;sub_location_name&gt;''

If sub-location is grouped (there is several crypts, caves etc.) first one should not have 1 in the end.

Examples: 
 w1m1-cemetery
 w1m2-pillars-crypt
 w1m2-pillars-crypt2

Test levels are special case, they should be prefixed by '''test-'''. Test levels are not added to game release build.

==Map props==
All level props is saved to models/maps/&lt;location_name&gt; folders. Use model names convention to name them.

Example:

 &lt;font color=green&gt;// Correct:&lt;/font&gt;
 '''terrain.ase'''
 &lt;font color=green&gt;// Wrong:&lt;/font&gt;
 '''02.ase'''
 '''terr01b.ASE'''

{{navigation footer|}}
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Repository Reference/Repository structure in-depth</title>
    <ns>0</ns>
    <id>249</id>
      <sha1>fj89npa01c1mh4tp0zlhlw8kro2bi7s</sha1>
    <revision>
      <id>2534</id>
      <timestamp>2012-08-09T14:13:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{navigation title|Naming conventions}}  ==kain/== &lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt; {| | [[File:Icon folder.png|16px|alt=...&quot;</comment>
      <text xml:space="preserve" bytes="9311">{{navigation title|Naming conventions}}

==kain/==
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| stores all DDS files to be loaded instead of base textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game (if running omnicide with no-home-dir option)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history (if running omnicide with no-home-dir option)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file (only if running game with developer option)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2535</id>
      <timestamp>2012-08-09T14:14:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="9322">{{navigation title|Naming conventions}}

==kain/==
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| stores all DDS files to be loaded instead of base textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game (if running omnicide with no-home-dir option)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history (if running omnicide with no-home-dir option)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file (only if running game with developer option)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

{{navigation footer|Automations}}</text>
    </revision>
    <revision>
      <id>2553</id>
      <timestamp>2012-08-09T14:43:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="9571">{{navigation title|Naming conventions}}

==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

{{navigation footer|Automations}}</text>
    </revision>
    <revision>
      <id>2554</id>
      <timestamp>2012-08-09T14:45:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="9542">{{navigation title|}}

==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

{{navigation footer|}}</text>
    </revision>
    <revision>
      <id>2614</id>
      <timestamp>2012-08-09T20:19:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="13174">{{navigation title|}}
==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;
{{navigation footer|}}

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| '''Graphics'''
| Various non-agme graphical files (logos, icons, site designs)
|}
&lt;/div&gt;</text>
    </revision>
    <revision>
      <id>2617</id>
      <timestamp>2012-08-09T20:21:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="13200">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;
{{navigation footer|}}

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| '''Graphics'''
| Various non-agme graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{finished}}</text>
    </revision>
    <revision>
      <id>2618</id>
      <timestamp>2012-08-09T20:22:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="13200">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| '''Graphics'''
| Various non-agme graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2619</id>
      <timestamp>2012-08-09T20:27:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Misc */</comment>
      <text xml:space="preserve" bytes="13288">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-agme graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>2633</id>
      <timestamp>2012-08-10T09:00:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Misc */</comment>
      <text xml:space="preserve" bytes="13288">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settigns, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-game graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3497</id>
      <timestamp>2013-01-24T12:31:20Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <text xml:space="preserve" bytes="13288">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them/
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by leve leditor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-game graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3498</id>
      <timestamp>2013-01-24T12:54:11Z</timestamp>
      <contributor>
        <username>Lofo1993</username>
        <id>8</id>
      </contributor>
      <comment>/* Game files */</comment>
      <text xml:space="preserve" bytes="13287">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[#Building a Game|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-game graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3508</id>
      <timestamp>2013-01-24T14:14:28Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>/* Game files */</comment>
      <text xml:space="preserve" bytes="13326">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[Repository_Reference/Building_a_Game#Textures_DDS_cache|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

====models/mapobjects/====
One or largest model folders. It contains models to be used on levels as [[func_model]] or [[func_gamemodel]].

{{tip|Once development progressing, new mapobject themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cave'''
| models for 'cave' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| models for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| models for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''graveyard'''
| models for 'graveyard' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''inn'''
| models for 'inn' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''misc'''
| unthemed widely used models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''outdoor'''
| models for 'Nosgoth Outdoors' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spikes'''
| models used in spike zones
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''town'''
| models for 'town' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''trees'''
| tree models
|}
&lt;/div&gt;

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-game graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3560</id>
      <timestamp>2013-01-29T22:29:06Z</timestamp>
      <contributor>
        <ip>91.201.64.27</ip>
      </contributor>
      <comment>/* models/mapobjects/ */</comment>
      <text xml:space="preserve" bytes="12318">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[Repository_Reference/Building_a_Game#Textures_DDS_cache|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

t2unP8  &lt;a href=&quot;http://rzlcqxmivbyz.com/&quot;&gt;rzlcqxmivbyz&lt;/a&gt;, [url=http://rszwhkvclfmb.com/]rszwhkvclfmb[/url], [link=http://bfyhxuzpmmew.com/]bfyhxuzpmmew[/link], http://jcoybqshtuxn.com/

==Development kit==
devkit/

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''bloodpill'''
| [[BloodPill|Blood Pill]] utility
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| tools for making cubemaps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''launcher'''
| source code for launcher
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''modelling'''
| tools for modelling (coverters, exporters)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''notepad++'''
| syntax highlight scripts for notepad++
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''other'''
| other tools
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''quakec'''
| game logic QuakeC sourcecode (client, server and menu)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''spr32edit'''
| Tool to edit sprites
|}
&lt;/div&gt;

===devkit/modelling===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dpmwizard'''
| DPMWizard tool (make [[DPM]] models from Half-Life [[SMD]] models)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gensurf'''
| An old tool to generate brush-based terrain from heightmaps or random noises.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins'''
| Import/Export plugins for various game formats used with Darkplaces engine.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plugins_src'''
| Source code for plugins.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''qme'''
| Old program to edit [[MDL]] models.
|-
| [[File:Icon md3compiler.png|16px|alt=|link=]] 
| '''MD3Compiler.exe'''
| [[MD3 Compiler|NPherno's MD3 Compiler]]
|}
&lt;/div&gt;

===devkit/quakec===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| QuakeC sources for client-side progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''menu.dat'''
| QuakeC sources for menu progs
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''progs.dat'''
| QuakeC sources for game progs (server game logic)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''shared'''
| Shared QuakeC code (libraries, systems)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_csprogs.bat'''
| Script to compile client-side progs into '''kain/csprogs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_menu.bat'''
| Script to compile menu progs into '''kain/menu.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''compile_progs.bat'''
| Script to compile game progs into '''kain/progs.dat'''
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''fteqcc.exe'''
| FTEQCC QuakeC source compiler
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''sourcescanner.exe'''
| SourceScanner - a tool to make level editor entity defs (mapeditor/kain.game/kain/entities.ent) from QuakeC source.
|}
&lt;/div&gt;

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-game graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3611</id>
      <timestamp>2013-02-22T21:20:11Z</timestamp>
      <contributor>
        <ip>91.201.64.27</ip>
      </contributor>
      <comment>/* Development kit */</comment>
      <text xml:space="preserve" bytes="9293">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[Repository_Reference/Building_a_Game#Textures_DDS_cache|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

t2unP8  &lt;a href=&quot;http://rzlcqxmivbyz.com/&quot;&gt;rzlcqxmivbyz&lt;/a&gt;, [url=http://rszwhkvclfmb.com/]rszwhkvclfmb[/url], [link=http://bfyhxuzpmmew.com/]bfyhxuzpmmew[/link], http://jcoybqshtuxn.com/

0,  http://buycigaretteseasely.com/#3496 cigarettes,

==Misc==
All misc files are stored in the '''misc/''' folder, there can be many subfolders there, but here we only list most useful.

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Balance and Docs'''
| various documents regarding original game, dialogue scripts, weapon damage listings etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Concept Art'''
| All concept art submitted to Blood Omnicide.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''Graphics'''
| Various non-game graphical files (logos, icons, site designs)
|}
&lt;/div&gt;

{{navigation footer|}}
{{finished}}</text>
    </revision>
    <revision>
      <id>3614</id>
      <timestamp>2013-03-22T11:37:57Z</timestamp>
      <contributor>
        <ip>46.161.41.27</ip>
      </contributor>
      <comment>/* Misc */</comment>
      <text xml:space="preserve" bytes="8660">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[Repository_Reference/Building_a_Game#Textures_DDS_cache|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;

t2unP8  &lt;a href=&quot;http://rzlcqxmivbyz.com/&quot;&gt;rzlcqxmivbyz&lt;/a&gt;, [url=http://rszwhkvclfmb.com/]rszwhkvclfmb[/url], [link=http://bfyhxuzpmmew.com/]bfyhxuzpmmew[/link], http://jcoybqshtuxn.com/

0,  http://buycigaretteseasely.com/#3496 cigarettes,

2,  http://treat-ed.co.uk/#2505 viagra,</text>
    </revision>
    <revision>
      <id>3630</id>
      <timestamp>2013-04-04T19:58:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="8376">{{navigation title|}}
{{grammar}}
==User files==
User files are files created by user, depending of engine settings, they could be located in game folder or in '''My Documents/My Games/omnicide'''.
Here is draft listing of this files:
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''data'''
| this directory is created and managed by engine, it stores savegames, edited files, temp files etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dds'''
| dynamically created DDS files (fonts, locale images)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''screenshots'''
| screenshots taken from game
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''videos'''
| FMV's and recorded with '''cl_capturevideo''' videos
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''config.cfg'''
| game config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.log'''
| engine log file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''darkplaces_history.txt'''
| console typing history
|}
&lt;/div&gt;

==Game files==
kain/
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cubemaps'''
| cubemap light filters used on lights (animated cubemaps is stored in subfolders)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''game'''
| game-related scripts (map scripts, gamemodel scripts etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''gfx'''
| all 2d textures used for graphical user interface
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''glsl'''
| OpenGL GLSL shaders
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''locale'''
| this folder stores all locales
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| game levels and it's additional files (lights, sources, lightmaps etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| all game 3d models and textures for them
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''music'''
| game music
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''particles'''
| textures used on particles
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''radiant'''
| textures and scripts used by level editor
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''scripts'''
| material scripts and client-side scripts such as menus, environments etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''sound'''
| all game sounds
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''textures'''
| textures used on map surfaces (brushes, curves, terrains etc.)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''csprogs.dat'''
| client-side compiled game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''effectinfo.txt'''
| effects script
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY0.PK3'''
| Blood Omen original files (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY1.PK3'''
| Blood Omen sounds from demo version, this file only exist if installing PlayStation version of the game
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY2.PK3'''
| Blood Omen FMV's (created during installation)
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''LEGACY3.PK3'''
| Blood Omen sprites DDS cache
|-
| [[File:Icon archive.png|16px|alt=|link=]] 
| '''PILL500.PK3'''
| generated textures DDS cache (see [[Repository_Reference/Building_a_Game#Textures_DDS_cache|Building a Game/Textures DDS cache]])
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''lightstyles.txt'''
| Lightstyles table
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''menu.dat'''
| compiled game logic for a menu
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''pill.big'''
| Blood Omen original file (copied during installation)
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''progs.dat'''
| compiled server-side game logic
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''quake.rc'''
| engine startup file
|}
&lt;/div&gt;

===game/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| [[Map configuration script|map configuration scripts]], each file holds a script for particular map
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''models'''
| [[Gamemodel script|gamemodel scripts]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''default.cfg'''
| Defaut config file
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''engine.cfg'''
| Engine [[CFG|config file]]
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''omnicide.cfg'''
| Blood Omnicide-specific config file (loaded after engine config file)
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| [[Worldmap script|worldmap script]] for prologue game part
|-
| [[File:Icon file.png|16px|alt=|link=]] 
| '''world0.nsx'''
| worldmap script for the present game part
|}
&lt;/div&gt;

===textures/===
{{tip|Once development progressing, new themes get added.}}

&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''common'''
| textures for [[Common materials|common materials]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''cellar'''
| textures for 'cellar' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''crypt'''
| textures for 'crypt' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''decals'''
| all decal textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''dungeon'''
| textures for 'dungeon' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''envmaps'''
| environment maps and cubemaps used on materials for cubemap reflections and tcGen environment
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''liquids'''
| textures used for liquids - lava, water, swamp
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mausoleum'''
| textures for 'mausoleum' theme
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''murals'''
| murals for spells, artifacts, events etc.
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''signboard'''
| textures for signboards
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''special'''
| special textures (overlays, force-material textures etc.)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''surfaces'''
| generic surface textures
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''terrain'''
| textures used for terrain blending
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''towns'''
| textures for 'town' theme
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''blackmap.tga'''
| simple black texture
|-
| [[File:Icon texture.png|16px|alt=|link=]] 
| '''checker.tga'''
| common checker texture for testing UV distortions
|}
&lt;/div&gt;

===models/===
&lt;div style=&quot;border: 1px #999 dotted; padding: 8px; margin: 4px;vertical-align:bottom&quot;&gt;
{|
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''captives'''
| 3d captive models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enemies'''
| test 3d models of enemies
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''enviro'''
| models used in [[Environment script|environment scripts]]
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''fx'''
| various models used in special effects
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''items'''
| item models
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''mapobjects'''
| models to be used on levels
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''maps'''
| specific prop models created for levels (such as terrains)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''new'''
| all new models to be approved (and get texture and material created) goes here
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''plants'''
| Foliage models, such as grass
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''teststuff'''
| all test-only stuff (not exported to game's installer)
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''traps'''
| models to be used on various traps
|-
| [[File:Icon folder.png|16px|alt=|link=]] 
| '''weapons'''
| weapon models
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''cube.mdl'''
| 4x4 units cube model
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''null.mdl'''
| model with no geometry
|-
| [[File:Icon raw.png|16px|alt=|link=]] 
| '''point.mdl'''
| a sphere with an arrow (used for testun purposes)
|}
&lt;/div&gt;</text>
    </revision>
  </page>
  <page>
    <title>SaveId</title>
    <ns>0</ns>
    <id>83</id>
      <sha1>i0lopvrsic6fjdkpaajzdhefi19sijx</sha1>
    <revision>
      <id>830</id>
      <timestamp>2012-07-16T12:40:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegame...&quot;</comment>
      <text xml:space="preserve" bytes="479">SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegames to store information about levels that was already visited.

Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.</text>
    </revision>
    <revision>
      <id>831</id>
      <timestamp>2012-07-16T12:40:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="480">SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegames to store information about levels that was already visited.


Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.</text>
    </revision>
    <revision>
      <id>832</id>
      <timestamp>2012-07-16T12:40:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="479">SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegames to store information about levels that was already visited.

Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.</text>
    </revision>
    <revision>
      <id>833</id>
      <timestamp>2012-07-16T12:41:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="501">SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegames to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>834</id>
      <timestamp>2012-07-16T12:41:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="512">SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] NetRadiant plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegames to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>835</id>
      <timestamp>2012-07-16T12:41:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="512">SaveID - save identification. It is unique entity number with a level assigned with [[RWGTools]] NetRadiant plugin to a &quot;sid&quot; entity field. It is required to identify objects in savegames to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveID cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>836</id>
      <timestamp>2012-07-16T12:44:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="493">SaveID - entity savegame identificator key. It is a number, unique withing a level, assigned with [[RWGTools]] NetRadiant plugin to a &quot;sid&quot; entity field. It is required to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveID cannot be reused when new entity created. Also SaveID survives level editing and recompilation, allowing to extend existing game levels without breaking saved games.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>837</id>
      <timestamp>2012-07-16T12:56:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1365">{{article unfinished}}

SaveId - entity savegame identificator key. It is a number, unique withing a level, assigned with [[RWGTools]] NetRadiant plugin to a &quot;sid&quot; entity field. It is required to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

RWGTools have this options to manipulate SaveId's:

* Add - mark SaveId's on new entities
* Remove - remove SaveID's on selected entities (when they are significatly changed, they will get new number with next 'Add' operation)
* Clear - remove all SaveId's and clear world counter
* Check - checks map for duplicate saveid's and other errors

SaveID's is a courtesy of level re-entering which was core game feature of Blood Omen, but has no core support Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (it stores entity properties that was changed comparing to level initial state), then all savestrings with saveid's are into the level save table.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>849</id>
      <timestamp>2012-07-16T17:13:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1586">{{article unfinished}}

SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

RWGTools have this options to manipulate SaveId's:

* Add - mark SaveId's on new entities
* Remove - remove SaveID's on selected entities (when they are significatly changed, they will get new number with next 'Add' operation)
* Clear - remove all SaveId's and clear world counter
* Check - checks map for duplicate saveid's and other errors

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>850</id>
      <timestamp>2012-07-16T17:18:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1609">{{article unfinished}}

SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

= Operations with SaveId =
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

= How 're-entering' works =

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>851</id>
      <timestamp>2012-07-16T17:18:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1585">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

= Operations with SaveId =
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

= How 're-entering' works =

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1053</id>
      <timestamp>2012-07-17T20:38:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1589">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2219</id>
      <timestamp>2012-07-30T18:51:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1602">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2221</id>
      <timestamp>2012-07-30T18:55:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1589">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2223</id>
      <timestamp>2012-07-30T18:59:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1602">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2225</id>
      <timestamp>2012-07-30T19:02:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1589">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2227</id>
      <timestamp>2012-07-30T19:16:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1602">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2229</id>
      <timestamp>2012-07-30T19:18:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1589">SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2307</id>
      <timestamp>2012-07-30T21:55:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1614">{{grammar}}
SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that was already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities
* Remap - this will re-mark all entities (this is will break savegames)
* Clear - remove all SaveId's and clear world counter (this is will break savegames)
* Check - checks map for duplicate saveid's and other errors

== How 're-entering' works ==

SaveID's is a courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entrities with SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in reenter table and loads properties from there.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2713</id>
      <timestamp>2012-09-28T13:55:54Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="1623">{{grammar checked|darth}}
SaveId - entity savegame identificator key. It is a number, unique within a level, assigned with [[RWGTools]] to a &quot;sid&quot; entity field. It is required for gamecode to store information about levels that were already visited. Instead of entity number (assigned by engine when entity is spawned) SaveId cannot be reused when new entity is created. Also SaveId survives level editing and recompilation, allowing to extend existing game levels without [[break savegame | breaking saved games]].

== Operations with SaveId ==
RWGTools have this options to manipulate SaveId's:

* Mark - mark SaveId's on new entities.
* Remap - this will re-mark all entities (will break savegames).
* Clear - remove all SaveId's and clear world counter (will break savegames).
* Check - checks map for duplicate SaveId's and other errors.

== How 're-entering' works ==

SaveID's are courtesy of level re-entering which is core game feature in Blood Omen, but has no core support in Darkplaces engine. Re-entering is a part of Blood Omnicide gamelogic. It follows this rules:

* On level exit, all entities with a SaveId launch their saving function (class-dependent) which forms a savestring for each entity (storing entity properties that was changed comparing to level initial state), then all savestrings get packed into the level save lumps.
* When level is loaded, gamecode checks if this level has a save lump, and loads it into the reenter array of savestrings.
* Each entity when spawned, checks for corresponding record in the reenter table and loads properties from there.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Sawtooth</title>
    <ns>0</ns>
    <id>589</id>
      <sha1>1l537s0aguwxuxuexghobh2qbzdsu64</sha1>
    <revision>
      <id>3341</id>
      <timestamp>2012-12-27T20:53:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|eden|bo_enemy_sawtooth.gif|Sawtooth}} Sawtooth is one of Dark Eden mutants. Mouth of monster turned inside-out, leaving teeth outside. Strong armor makes it difficul...&quot;</comment>
      <text xml:space="preserve" bytes="451">{{BoEnemy|eden|bo_enemy_sawtooth.gif|Sawtooth}}
Sawtooth is one of Dark Eden mutants. Mouth of monster turned inside-out, leaving teeth outside.
Strong armor makes it difficult to kill. Melee attack is quite slow however, so can be avoided.

==Stats==
:Health: 40
:Damage: 10
:Blood: red
:Walk speed: medium
:Character type: animal
:Entity: [[animal_sawtooth]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred sawtooth.png
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
    <revision>
      <id>3345</id>
      <timestamp>2012-12-27T21:40:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="721">{{BoEnemy|eden|bo_enemy_sawtooth.gif|Sawtooth}}
Sawtooth is one of Dark Eden mutants. It is hard to say which creatures was used to create sawtooth: thick shell of gray material that protects the heavy body, covered with brown hair in exposed places, small thick legs, missing eyes and a necklace of small shark-like teeth, resembling a saw. It looks like mouth of monster turned inside-out, leaving teeth outside. Strong armor makes it difficult to kill. Melee attack is quite slow however and can be avoided.

==Stats==
:Health: 40
:Damage: 10
:Blood: red
:Walk speed: medium
:Character type: animal
:Entity: [[animal_sawtooth]]

==Concept art gallery==
&lt;gallery&gt;
File:Amddred sawtooth.png
&lt;/gallery&gt;

__NOEDITSECTION__</text>
    </revision>
  </page>
  <page>
    <title>Shader</title>
    <ns>0</ns>
    <id>76</id>
      <sha1>5hr115p3uwr206hmdb4vstilgrohr46</sha1>
    <revision>
      <id>752</id>
      <timestamp>2012-07-16T07:40:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Shader (verb to shade) term have several meanings.  1. Shader - program for 3D rendering pipeline which could be written ni various 3D shader languges (GLSL, HLSL, Cg, ARB etc...&quot;</comment>
      <text xml:space="preserve" bytes="855">Shader (verb to shade) term have several meanings.

1. Shader - program for 3D rendering pipeline which could be written ni various 3D shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Shader - Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So sometimes they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>753</id>
      <timestamp>2012-07-16T07:41:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="859">Shader (verb ''to shade'') term have several meanings.

1. Shader - program for 3D rendering pipeline which could be written ni various 3D shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Shader - Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So sometimes they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>754</id>
      <timestamp>2012-07-16T07:42:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="898">Shader (verb ''to shade'') term have several meanings.

1. Shader - [[http://en.wikipedia.org/wiki/Shader | program for 3D rendering pipeline]] which could be written in various shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Shader - Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So sometimes they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>755</id>
      <timestamp>2012-07-16T07:42:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="896">Shader (verb ''to shade'') term have several meanings.

1. Shader - [http://en.wikipedia.org/wiki/Shader | program for 3D rendering pipeline] which could be written in various shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Shader - Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So sometimes they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>756</id>
      <timestamp>2012-07-16T07:42:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="894">Shader (verb ''to shade'') term have several meanings.

1. Shader - [http://en.wikipedia.org/wiki/Shader program for 3D rendering pipeline] which could be written in various shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Shader - Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So sometimes they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>757</id>
      <timestamp>2012-07-16T07:43:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="876">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in various shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So sometimes they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>758</id>
      <timestamp>2012-07-16T07:44:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="905">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in various shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>759</id>
      <timestamp>2012-07-16T07:44:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="905">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in various shader languges (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>985</id>
      <timestamp>2012-07-17T05:13:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="905">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3 materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>986</id>
      <timestamp>2012-07-17T05:13:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="906">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3, materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders, which is not correct. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>987</id>
      <timestamp>2012-07-17T05:13:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="884">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3, materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>2311</id>
      <timestamp>2012-07-30T21:57:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="897">Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3, materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2312</id>
      <timestamp>2012-07-30T21:57:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="909">{{grammar}}
Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3, materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders. Since Darkplaces engine's material system using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2354</id>
      <timestamp>2012-08-01T09:45:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="945">{{grammar}}
Shader (verb ''to shade'') term have several meanings.

1. [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). There is vertex shader, pixel shader, geometry shader etc. This is most ''official'' meaning.

2. Quake 3 Material. In Id Tech 3, materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). So after q3, sometimes materials they get called as shaders. Since Darkplaces engine's [[Darkplaces material system|material system]] using Id Tech 3 material approach as a base, it's materials sometimes called shaders too (also material files extension is .shader).

3. Programmable block for anything that is processed in realtime. There is sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runned in realtime.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2710</id>
      <timestamp>2012-09-28T13:45:12Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="906">{{grammar checked|darth}}
Shader (verb ''to shade'') may refer to:

* [http://en.wikipedia.org/wiki/Shader Program for 3D rendering pipeline] which could be written in special shader language (GLSL, HLSL, Cg, ARB etc.). E.g. vertex shader, pixel shader, geometry shader etc. 

* Quake 3 Material. In Id Tech 3, materials are named shaders (this includes many techical papers that describe [[MD3]], [[Q3BSP]] etc.). In this regard, sometimes materials may be called shaders. Since Darkplaces engine's [[Darkplaces material system|material system]] is using Id Tech 3 material approach as a base, its materials sometimes called shaders as well (also material files extension is ''.shader'').

* Programmable block for anything that is processed in realtime. E.g. sound shaders, light shaders, entity shaders etc. ''Shader'' is different from script as it runs in realtime.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Shadow groups</title>
    <ns>0</ns>
    <id>271</id>
      <sha1>giflczajbcnojv6r8rd35dj5t6b9gik</sha1>
    <revision>
      <id>2661</id>
      <timestamp>2012-09-25T12:23:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{unfinished}} Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light...&quot;</comment>
      <text xml:space="preserve" bytes="874">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. A numbers should be used for shadows groups (1, 2, 3, 100, 1000 etc.), negative values are allowed.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows) and no worldspawn.

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

=See also=
*[[Lightmap]]
*[[Vertex lighting]]</text>
    </revision>
    <revision>
      <id>2664</id>
      <timestamp>2012-09-25T12:39:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="897">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. A numbers should be used for shadows groups (1, 2, 3, 100, 1000 etc.), negative values are allowed.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows) and no worldspawn.

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3702</id>
      <timestamp>2014-07-20T22:54:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1120">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. A numbers should be used for shadows groups (-127 to 127 etc.), negative values are allowed.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: entity will not receive shadows from anything (occlusion test is not performed)
#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

=Shadow groups and ambient occlusion=
Shadow groups affects the looks of ambient occlusion. Mostly the gain effect (which brightens the edges).

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3703</id>
      <timestamp>2014-07-20T23:10:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1490">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. A numbers should be used for shadows groups (-127 to 127 etc.), negative values are allowed.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).

#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

=Shadow groups and ambient occlusion=
Shadow groups affects the looks of ambient occlusion. Mostly the gain effect (which brightens the edges).

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3704</id>
      <timestamp>2014-07-20T23:14:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1347">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. 
A numbers should be used for shadows groups. Blood map allows shadow groups from -127 to 127.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).

#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3705</id>
      <timestamp>2014-07-20T23:16:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1348">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. 

A numbers should be used for shadows groups. Blood map allows shadow groups from -127 to 127.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).

#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3706</id>
      <timestamp>2014-07-20T23:17:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1348">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. 

A numbers should be used for shadows groups. Blood map allows shadow groups from -127 to 127.

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).

#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3707</id>
      <timestamp>2014-07-20T23:20:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1347">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. 

A numbers should be used for shadows groups. Blood map allows shadow groups from -127 to 127.

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).
#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3708</id>
      <timestamp>2014-07-21T11:19:41Z</timestamp>
      <contributor>
        <ip>185.10.129.248</ip>
      </contributor>
      <text xml:space="preserve" bytes="2269">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. 

A numbers should be used for shadows groups. Blood map allows shadow groups from -127 to 127.

By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities have cast shadows 0 and receive shadows 1.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from self and from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).
#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

{note|this rules is written against BloodMap compiler, Q3map2 rules may differ}

=Usage=
Shadow groups are used to hijack the shadow casting in order to fix bugs, remove unneeded shadows or add shadow casting for bmodels.

==Example 1: Trap made of func_train ==

You have two func_trains one replacing other during trap activation (Blood Omen spike traps). So you need both trains be rendered in their destinatino position, having world shadows cast upon them, but not casting shadows from each other. 

Solution: set _cs 2 _cs -2 on first train, and _rs 3 _cs -3 on the second. The point is that each train should have receive shadows group that is able to receive shadows from world, and cast shadows that is not casting to world, but casing to object itself (so ambient occlusion would be correct). The usage of 2 and -3 are casual, it can be 3 or -5, 6 and -10, no matter, just it has to be different.

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>3709</id>
      <timestamp>2014-07-21T20:39:59Z</timestamp>
      <contributor>
        <ip>185.10.129.248</ip>
      </contributor>
      <text xml:space="preserve" bytes="2523">{{unfinished}}
Shadows group is a combination of '''_cs''' (cast shadows) and '''_rs''' (receive shadows) [[entity]] keys used to control how entity cast lightmap/vertex light shadows. Shadow groups are used to hijack the shadow casting in order to fix bugs, remove unneeded shadows or add shadow casting for bmodels.

A numbers should be used for shadows groups. BloodMap allows shadow groups from -127 to 127.

Shadows groups are applied during lightmapping of entity using this rules:

#Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
#Receive shadows is 1: only receive shadows from self and from objects with cast shadows 1 (the worldspawn cast shadows).
#Receive shadows is &gt; 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
#Receive shadows is &lt; 1: only receive shadows from objects with same abs(cast shadows).
#Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
#Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
#Cast shadows is &gt; 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
#Cast shadows is &lt; 1: only cast shadows on objects with same abs(receive shadows).

{{tip|This rules is written against BloodMap compiler, Q3map2 rules may differ}}

=Default shadow groups=
By default [[worldspawn]] and [[func_group]] have cast shadows and receive shadows 1. All other entities are mean to be moved/deleted during gameplat and so have cast shadows 0 and receive shadows 1.

Mapper can make levels to look better if entities which are known to be static (such as func_walls, trains rendered in the start position etc.) will receive explicit shadow casting.

==Usage example 1: Trap made of func_train==

You have two func_trains one replacing other during trap activation (Blood Omen spike traps). So you need both trains be rendered in their destinatino position, having world shadows cast upon them, but not casting shadows from each other. 

Solution: set _cs 2 _cs -2 on first train, and _rs 3 _cs -3 on the second. The point is that each train should have receive shadows group that is able to receive shadows from world, and cast shadows that is not casting to world, but casing to object itself (so ambient occlusion would be correct). The usage of 2 and -3 are casual, it can be 3 or -5, 6 and -10, no matter, just it has to be different.

=See also=
*[[Lightmap]]
*[[Vertex lighting]]

[[Category:Glossary]]</text>
    </revision>
  </page>
  <page>
    <title>TGA</title>
    <ns>0</ns>
    <id>7</id>
      <sha1>oig873dlr7gwepr4prdhcixag9q2udl</sha1>
    <revision>
      <id>44</id>
      <timestamp>2012-07-02T15:14:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;TGA refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format.   TGA is general format to store uncompressed textures.&quot;</comment>
      <text xml:space="preserve" bytes="148">TGA refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.</text>
    </revision>
    <revision>
      <id>45</id>
      <timestamp>2012-07-02T15:14:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="175">TGA refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>46</id>
      <timestamp>2012-07-02T15:15:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="186">.TGA extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1009</id>
      <timestamp>2012-07-17T05:37:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="186">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1011</id>
      <timestamp>2012-07-17T05:54:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="595">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions supported ==

{| width=600 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=88% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit Grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1012</id>
      <timestamp>2012-07-17T05:55:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="596">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions supported ==

{| width=600 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit Grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1013</id>
      <timestamp>2012-07-17T05:55:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="596">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions supported ==

{| width=400 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit Grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1014</id>
      <timestamp>2012-07-17T05:55:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="596">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions supported ==

{| width=220 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit Grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1015</id>
      <timestamp>2012-07-17T05:55:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="596">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions supported ==

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit Grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1016</id>
      <timestamp>2012-07-17T05:55:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="596">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions supported ==

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1017</id>
      <timestamp>2012-07-17T05:55:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="585">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format versions =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1018</id>
      <timestamp>2012-07-17T06:02:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="584">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

TGA is general format to store uncompressed textures.

= Format support =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1049</id>
      <timestamp>2012-07-17T20:34:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="529">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

= Format support =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% bgcolor=#EEDFDF | Targe Type
! width=10% bgcolor=#EEDFDF | Darkplaces
! width=10% bgcolor=#EEDFDF | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1100</id>
      <timestamp>2012-07-17T22:56:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="523">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

= Format support =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% {{tablehead}} | Targe Type
! width=10% {{tablehead}} | Darkplaces
! width=10% {{tablehead}} | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1101</id>
      <timestamp>2012-07-17T22:56:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="481">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

= Format support =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% | Targe Type
! width=10% | Darkplaces
! width=10% | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]</text>
    </revision>
    <revision>
      <id>1333</id>
      <timestamp>2012-07-20T11:02:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="512">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

= Format support =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% | Targe Type
! width=10% | Darkplaces
! width=10% | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2217</id>
      <timestamp>2012-07-30T09:33:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="525">This extension refers to [http://en.wikipedia.org/wiki/Truevision_TGA | Truevision Targa] image format. 

= Format support =

{| width=300 cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=80% | Targe Type
! width=10% | Darkplaces
! width=10% | NetRadiant
|-
| 8-bit grayscale
| +
| -
|-
| 8-bit paletted
| +
| - 
|-
| 16-bit
| +
| - 
|-
| 24-bit
| +
| +
|-
| 32-bit
| +
| +
|-
| 24-bit RLE
| +
| -
|-
| 32-bit RLE
| +
| -
|}

[[Category:File formats]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Talk:Repository Reference/Repository structure in-depth</title>
    <ns>1</ns>
    <id>654</id>
      <sha1>hi08hvma1y927brm39r4xwidc6xyed4</sha1>
    <revision>
      <id>3629</id>
      <timestamp>2013-03-29T19:59:23Z</timestamp>
      <contributor>
        <ip>46.161.41.27</ip>
      </contributor>
      <comment>RYMsfvyQyhNgyp</comment>
      <text xml:space="preserve" bytes="34">0,  http://uk-pills.co.uk/ viagra,</text>
    </revision>
    <revision>
      <id>3631</id>
      <timestamp>2013-04-04T19:58:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>Blanked the page</comment>
      <text xml:space="preserve" bytes="0" />
    </revision>
  </page>
  <page>
    <title>Template:BoEnemy</title>
    <ns>10</ns>
    <id>316</id>
      <sha1>bzula7hncj4l4e9nvy5khtrw8zuruet</sha1>
    <revision>
      <id>2939</id>
      <timestamp>2012-11-28T19:34:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt; This template is created for blood omen enemies reference. ...&quot;</comment>
      <text xml:space="preserve" bytes="495">&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemyGif|background|picture_path}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2940</id>
      <timestamp>2012-11-28T19:35:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="526">&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot; style=&quot;border: 1px #AAA solid&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemyGif|background|picture_path}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2941</id>
      <timestamp>2012-11-28T19:35:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="526">&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot; style=&quot;border: 1px #222 solid&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemyGif|background|picture_path}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2942</id>
      <timestamp>2012-11-28T19:36:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:BoEnemyGif]] to [[Template:BoEnemy]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="526">&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot; style=&quot;border: 1px #222 solid&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemyGif|background|picture_path}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2943</id>
      <timestamp>2012-11-28T19:39:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="672">&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot; style=&quot;border: 1px #222 solid&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{3}}}&lt;br /&gt;Attack: {{{4}}}&lt;br /&gt;Blood: {{{5}}}&lt;br /&gt;Entity: {{{6}}}&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2956</id>
      <timestamp>2012-11-29T21:28:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="669">&lt;includeonly&gt;&lt;table class=&quot;bo_bg_{{{1}}}&quot; style=&quot;border: 1px #222 solid&quot;&gt;&lt;tr&gt;&lt;td&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{3}}}&lt;br /&gt;Attack: {{{4}}}&lt;br /&gt;Blood: {{{5}}}&lt;br /&gt;Entity: {{{6}}}&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2960</id>
      <timestamp>2012-11-29T21:34:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="669">&lt;includeonly&gt;&lt;table style=&quot;border: 1px #222 solid&quot;&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{3}}}&lt;br /&gt;Attack: {{{4}}}&lt;br /&gt;Blood: {{{5}}}&lt;br /&gt;Entity: {{{6}}}&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;bo_bg_{{{1}}}&quot;&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2961</id>
      <timestamp>2012-11-29T21:36:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="741">&lt;includeonly&gt;&lt;table style=&quot;border: 1px #222 solid&quot;&gt;&lt;tr&gt;&lt;td colspan=2&gt;Blood Omen character&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Type: {{{3}}}&lt;br /&gt;Health: {{{4}}}&lt;br /&gt;Attack: {{{5}}}&lt;br /&gt;Blood: {{{6}}}&lt;br /&gt;Entity: {{{7}}}&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;bo_bg_{{{1}}}&quot;&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|type|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2962</id>
      <timestamp>2012-11-29T21:37:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="848">&lt;includeonly&gt;&lt;table style=&quot;border: 1px #222 solid;float:right&quot;&gt;&lt;tr&gt;&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;Blood Omen character&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Type: {{{3}}}&lt;br /&gt;Health: {{{4}}}&lt;br /&gt;Attack: {{{5}}}&lt;br /&gt;Blood: {{{6}}}&lt;br /&gt;Entity: {{{7}}}&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;bo_bg_{{{1}}}&quot;&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|type|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2963</id>
      <timestamp>2012-11-29T21:38:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="818">&lt;includeonly&gt;&lt;table style=&quot;border: 1px #222 solid;float:right&quot;&gt;&lt;tr&gt;&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;{{{3}}}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{4}}}&lt;br /&gt;Attack: {{{5}}}&lt;br /&gt;Blood: {{{6}}}&lt;br /&gt;Entity: {{{7}}}&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;bo_bg_{{{1}}}&quot;&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|caption|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2964</id>
      <timestamp>2012-11-29T21:38:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="819">&lt;includeonly&gt;&lt;table style=&quot;border: 1px #222 solid;float:right&quot;&gt;&lt;tr&gt;&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{3}}}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{4}}}&lt;br /&gt;Attack: {{{5}}}&lt;br /&gt;Blood: {{{6}}}&lt;br /&gt;Entity: {{{7}}}&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;bo_bg_{{{1}}}&quot;&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|caption|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2965</id>
      <timestamp>2012-11-29T21:46:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="853">&lt;includeonly&gt;&lt;table style=&quot;border: 1px #222 solid;float:right&quot;&gt;&lt;tr&gt;&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{3}}}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{4}}}&lt;br /&gt;Attack: {{{5}}}&lt;br /&gt;Blood: {{{6}}}&lt;br /&gt;Entity: {{{7}}}&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;bo_bg_{{{1}}}&quot;&gt;[[File:{{{2}}}|link=]]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;[[Category:Blood Omen characters]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture_path|caption|health|attack|blood|entity}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2966</id>
      <timestamp>2012-11-29T21:54:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1103">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2967</id>
      <timestamp>2012-11-29T21:55:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1150">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2968</id>
      <timestamp>2012-11-29T21:55:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1131">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2969</id>
      <timestamp>2012-11-29T21:57:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1159">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:1%;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2970</id>
      <timestamp>2012-11-29T21:57:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1159">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td width=1% colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2971</id>
      <timestamp>2012-11-29T21:58:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1169">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot; style=&quot;width:auto&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2972</id>
      <timestamp>2012-11-29T21:58:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1159">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot; width=1%&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2973</id>
      <timestamp>2012-11-29T21:59:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1170">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot; style=&quot;width:200px&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2974</id>
      <timestamp>2012-11-29T22:00:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1194">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:200px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;Entity: {{{entity|{{{7}}}}}}&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2975</id>
      <timestamp>2012-11-29T22:02:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1256">&lt;includeonly&gt;
&lt;table style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2976</id>
      <timestamp>2012-11-29T22:03:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1288">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2977</id>
      <timestamp>2012-11-29T22:04:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1298">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2979</id>
      <timestamp>2012-11-29T22:12:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1298">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;&lt;gallery&gt;{{{gallery|{{{7}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2980</id>
      <timestamp>2012-11-29T22:13:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1279">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2981</id>
      <timestamp>2012-11-29T22:14:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1298">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;&lt;gallery&gt;{{{gallery|{{{8}}}}}}&lt;/gallery&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2982</id>
      <timestamp>2012-11-29T22:15:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1279">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=2 style=&quot;border-left: 1px #222 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2983</id>
      <timestamp>2012-11-29T22:15:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1310">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-left: 1px #222 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2984</id>
      <timestamp>2012-11-29T22:17:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1332">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{caption|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{name|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|name|caption|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2985</id>
      <timestamp>2012-11-29T22:21:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2050">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2986</id>
      <timestamp>2012-11-29T22:22:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2081">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;border-bottom: 1px #222 solid;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2987</id>
      <timestamp>2012-11-29T22:22:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2113">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid;&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;border-bottom: 1px #222 solid;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2988</id>
      <timestamp>2012-11-29T22:26:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2237">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;border-bottom: 1px #222 solid;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2989</id>
      <timestamp>2012-11-29T22:27:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2208">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;border-bottom: 1px #222 solid;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2990</id>
      <timestamp>2012-11-29T22:29:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2378">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #222 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #222 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #222 solid&quot;&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px;border-bottom: 1px #222 solid&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-bottom: 1px #222 solid;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #222 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2991</id>
      <timestamp>2012-11-29T22:30:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2258">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #222 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #222 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #222 solid&quot;&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #222 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2992</id>
      <timestamp>2012-11-29T22:31:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2258">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #222 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #222 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #222 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #222 solid;border-bottom: 1px #222 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #222 solid&quot;&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #222 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #222 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2996</id>
      <timestamp>2012-11-29T22:34:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2258">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; style=&quot;border: 1px #AAA solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #AAA solid;border-bottom: 1px #AAA solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #AAA solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #AAA solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #AAA solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #AAA solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #AAA solid;border-bottom: 1px #AAA solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #AAA solid&quot;&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #AAA solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #AAA solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2997</id>
      <timestamp>2012-11-29T22:36:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2258">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; style=&quot;border: 1px #333 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #333 solid;border-bottom: 1px #333 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #333 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #333 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #333 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #333 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #333 solid;border-bottom: 1px #333 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #333 solid&quot;&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #333 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #333 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2999</id>
      <timestamp>2012-11-29T22:38:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2282">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; style=&quot;border: 1px #333 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #333 solid;border-bottom: 1px #333 solid;font-weight:bold;text-align:left;vertical-align:middle;padding:5px&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #333 solid&quot;&gt;{{{gallery|{{{8}}}}}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #333 solid;vertical-align:middle;padding:8px&quot;&gt;Health: {{{health|{{{4}}}}}}&lt;br /&gt;Attack: {{{attack|{{{5}}}}}}&lt;br /&gt;Blood: {{{blood|{{{6}}}}}}&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #333 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name|health|attack|blood|entity|gallery=&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt1.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;File:ConceptArt2.jpg&lt;/nowiki&gt;
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #333 solid;border-bottom:0px;min-height:200px;table-layout:fixed;border-collapse:collapse;width:100%;padding:5px&quot;&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;width:350px;border-right: 1px #333 solid;border-bottom: 1px #333 solid;font-weight:bold;text-align:left;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;
&lt;td rowspan=3 style=&quot;border-bottom: 1px #333 solid&quot;&gt;gallery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width:350px&quot; class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;
&lt;td style=&quot;width:150px;border-right: 1px #333 solid;vertical-align:middle;padding:8px&quot;&gt;Health: health&lt;br /&gt;Attack: attack&lt;br /&gt;Blood: blood&lt;br /&gt;entity definition&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=2 style=&quot;padding:0px;;border-right:0px;border-bottom: 1px #333 solid&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Possible backgrounds:
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3124</id>
      <timestamp>2012-11-30T10:31:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1257">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #000 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name}}&lt;/nowiki&gt;

Example:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #000 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Possible animated pictures=====
See [[:Category:Blood Omen enemy pictures]].

=====Possible backgrounds=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3273</id>
      <timestamp>2012-11-30T11:14:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1258">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #000 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name}}&lt;/nowiki&gt;

Example:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;border: 1px #000 solid;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Possible animated pictures=====
See [[:Category:Blood Omen enemy pictures]].

=====Possible backgrounds=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3275</id>
      <timestamp>2012-11-30T11:18:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1212">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name}}&lt;/nowiki&gt;

Example:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Possible animated pictures=====
See [[:Category:Blood Omen enemy pictures]].

=====Possible backgrounds=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3313</id>
      <timestamp>2012-12-07T19:27:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1211">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;[[Category:Blood Omen characters]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name}}&lt;/nowiki&gt;

Example:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Possible animated pictures=====
See [[:Category:Blood Omen enemy pictures]].

=====Possible backgrounds=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3314</id>
      <timestamp>2012-12-07T19:27:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1210">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;[[Category:Blood Omen characters]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template is created for blood omen enemies reference.
 &lt;nowiki&gt;{{BoEnemy|background|picture|name}}&lt;/nowiki&gt;

Example:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Possible animated pictures=====
See [[:Category:Blood Omen enemy pictures]].

=====Possible backgrounds=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Bug</title>
    <ns>10</ns>
    <id>143</id>
      <sha1>rvjl45pbmjycasyz98raifcw07k89ix</sha1>
    <revision>
      <id>1805</id>
      <timestamp>2012-07-26T13:27:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;strong style=&quot;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;...&quot;</comment>
      <text xml:space="preserve" bytes="401">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;strong style=&quot;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/strong&gt;&lt;span style=&quot;display:table-cell;&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;noinclude&gt;
[[Category:Notice templates]]&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 {{bug|text describing bug}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1806</id>
      <timestamp>2012-07-26T13:27:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="391">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;strong style=&quot;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/strong&gt;&lt;span style=&quot;display:table-cell;&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 {{bug|text describing bug}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1808</id>
      <timestamp>2012-07-26T13:29:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="402">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 {{bug|text describing bug}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1815</id>
      <timestamp>2012-07-26T13:34:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="404">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 {{bug|text describing bug}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1820</id>
      <timestamp>2012-07-26T14:19:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="468">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;bug|text describing bug&lt;/nowiki&gt;}}&lt;/nowiki&gt;

{{bug|text describing bug}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1821</id>
      <timestamp>2012-07-26T14:19:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="467">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;bug|text describing bug&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{bug|text describing bug}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1844</id>
      <timestamp>2012-07-26T16:32:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="447">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;bug|text describing bug&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{bug|text describing bug}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1855</id>
      <timestamp>2012-07-26T16:37:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="453">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;bug|text describing bug&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{bug|text describing bug}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1939</id>
      <timestamp>2012-07-27T10:38:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="455">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about a bug.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;bug|text describing bug&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{bug|text describing bug}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Capitolo precedente</title>
    <ns>10</ns>
    <id>615</id>
      <sha1>5jmfqfkmhmov7fs8s2bx7ok1ewj9gth</sha1>
    <revision>
      <id>3449</id>
      <timestamp>2013-01-22T18:28:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}} &lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-l...&quot;</comment>
      <text xml:space="preserve" bytes="905">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|1}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3451</id>
      <timestamp>2013-01-22T18:41:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Intestazione]] to [[Template:Capitolo precedente]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="905">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|1}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3452</id>
      <timestamp>2013-01-22T18:42:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="905">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|1|{{#pos:{{PAGENAME}}|/|1}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3453</id>
      <timestamp>2013-01-22T18:42:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="905">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|1}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3454</id>
      <timestamp>2013-01-22T18:44:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="953">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|{{#pos:{{PAGENAME}}|/|0}}|{{#pos:{{PAGENAME}}|/|{{#pos:{{PAGENAME}}|/|0}}}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3455</id>
      <timestamp>2013-01-22T18:46:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="907">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|10|{{#pos:{{PAGENAME}}|/|10}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3456</id>
      <timestamp>2013-01-22T18:47:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="907">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|17|{{#pos:{{PAGENAME}}|/|17}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3457</id>
      <timestamp>2013-01-22T18:50:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="926">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|17| {{#expr:  {{#pos:{{PAGENAME}}|/|17}}-17}}   }}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3458</id>
      <timestamp>2013-01-22T18:51:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1002">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}|{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{important|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3460</id>
      <timestamp>2013-01-22T19:02:01Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1003">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}|{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{intestazione|Capitolo_Precedente}}&lt;/nowiki&gt;

{{importante|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3461</id>
      <timestamp>2013-01-22T19:03:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1010">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}|{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{capitolo precedente|Capitolo_Precedente}}&lt;/nowiki&gt;

{{importante|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3476</id>
      <timestamp>2013-01-22T19:21:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1042">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}|{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; capitolo precedente: [[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template imposta l'intestazione di un libro che sostituisce il titolo della pagina.

 &lt;nowiki&gt;{{capitolo precedente|Capitolo_Precedente}}&lt;/nowiki&gt;

{{importante|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Capitolo successivo</title>
    <ns>10</ns>
    <id>616</id>
      <sha1>scw3g3a7w3rgejc5mfk4qqjss6nm0oa</sha1>
    <revision>
      <id>3459</id>
      <timestamp>2013-01-22T18:58:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;br&gt; ---- {{#if: {{{1|}}} | &lt;font size=3&gt;Capitolo successivo: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]&lt;/font&gt;&lt;br&gt;}} [[Portal:InIt...&quot;</comment>
      <text xml:space="preserve" bytes="680">&lt;includeonly&gt;&lt;br&gt;
----
{{#if: {{{1|}}} | &lt;font size=3&gt;Capitolo successivo: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]&lt;/font&gt;&lt;br&gt;}}
[[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}| Torna all'indice]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[#top | Torna in cima alla pagina]]&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template inserirà a piè di pagina un blocco con i link &quot;Torna all'indice&quot; e &quot;Capitolo successivo&quot;.

 &lt;nowiki&gt;{{capitolo successivo|Capitolo_Successivo}}&lt;/nowiki&gt;

{{importante|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3475</id>
      <timestamp>2013-01-22T19:21:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="712">&lt;includeonly&gt;&lt;br&gt;
----
{{#if: {{{1|}}} | &lt;font size=3&gt;Capitolo successivo: [[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}/{{{1|}}} | {{{1|}}}]]&lt;/font&gt;&lt;br&gt;}}
[[Portal:InItalian/{{#sub:{{PAGENAME}}|17|{{#expr:{{#pos:{{PAGENAME}}|/|17}}-17}}}}| Torna all'indice]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[#top | Torna in cima alla pagina]]&lt;/includeonly&gt;&lt;noinclude&gt;
Questo template inserirà a piè di pagina un blocco con i link &quot;Torna all'indice&quot; e &quot;Capitolo successivo&quot;.

 &lt;nowiki&gt;{{capitolo successivo|Capitolo_Successivo}}&lt;/nowiki&gt;

{{importante|Tutte le pagine nel libro devono essere numerate come segue: '''Pagina dell'Indice'''/'''Capitolo'''}}
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Cmd</title>
    <ns>10</ns>
    <id>190</id>
      <sha1>oufzc8gbw79ku5wn41k65616f7tv5hw</sha1>
    <revision>
      <id>2297</id>
      <timestamp>2012-07-30T21:50:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:cvar.png|link=|alt=]]&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;di...&quot;</comment>
      <text xml:space="preserve" bytes="482">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:cvar.png|link=|alt=]]&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&lt;font style=&quot;font-weight:bold;&quot;&gt;{{{1}}}&lt;/font&gt; : {{{2}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template to post console commands in the article text.
 &lt;nowiki&gt;{{cmd|somecommand|description}}&lt;/nowiki&gt;

{{cmd|somecommand|description}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2957</id>
      <timestamp>2012-11-29T21:28:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="479">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:cvar.png|link=|alt=]]&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&lt;font style=&quot;font-weight:bold;&quot;&gt;{{{1}}}&lt;/font&gt; : {{{2}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template to post console commands in the article text.
 &lt;nowiki&gt;{{cmd|somecommand|description}}&lt;/nowiki&gt;

{{cmd|somecommand|description}}

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Consiglio</title>
    <ns>10</ns>
    <id>612</id>
      <sha1>k6u413jbjt3fxeamfhpgg15zkn6b3es</sha1>
    <revision>
      <id>3437</id>
      <timestamp>2013-01-22T18:05:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Consiglio:&lt;/font&gt;&lt;span style=&quot;display:t...&quot;</comment>
      <text xml:space="preserve" bytes="456">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Consiglio:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;consiglio|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{consiglio|some useful note}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3439</id>
      <timestamp>2013-01-22T18:08:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Consiglio]] to [[Template:Consiglio2]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="456">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Consiglio:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;consiglio|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{consiglio|some useful note}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3440</id>
      <timestamp>2013-01-22T18:08:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Consiglio2]] to [[Template:Consiglio]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="456">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Consiglio:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;consiglio|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{consiglio|some useful note}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3443</id>
      <timestamp>2013-01-22T18:12:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="452">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Consiglio:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Usa questo template quando vuoi notificare qualcosa di utile.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;consiglio|qualcosa di utile&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{consiglio|qualcosa di utile}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3445</id>
      <timestamp>2013-01-22T18:15:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="445">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Consiglio:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Usa questo template quando vuoi notificare qualcosa di utile.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;consiglio|qualcosa di utile&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{consiglio|qualcosa di utile}}

[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Cvar</title>
    <ns>10</ns>
    <id>154</id>
      <sha1>l0ew3d6fa8irptcwhd6swln0ixs62qy</sha1>
    <revision>
      <id>1933</id>
      <timestamp>2012-07-27T10:21:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;* {{{1}}} : {{{2}}}&lt;/includeonly&gt; &lt;noinclude&gt; Use this template to post cvars in the article text.  &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt; {{cvar|r_some...&quot;</comment>
      <text xml:space="preserve" bytes="240">&lt;includeonly&gt;* {{{1}}} : {{{2}}}&lt;/includeonly&gt;
&lt;noinclude&gt;
Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;
{{cvar|r_somecvar|description}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1934</id>
      <timestamp>2012-07-27T10:22:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="244">&lt;includeonly&gt;'''{{{1}}}''' : {{{2}}}&lt;/includeonly&gt;
&lt;noinclude&gt;
Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;
{{cvar|r_somecvar|description}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1935</id>
      <timestamp>2012-07-27T10:23:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="243">&lt;includeonly&gt;'''{{{1}}}''' : {{{2}}}&lt;/includeonly&gt;
&lt;noinclude&gt;Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;
{{cvar|r_somecvar|description}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1936</id>
      <timestamp>2012-07-27T10:34:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="241">&lt;includeonly&gt;'''{{{1}}}''' : {{{2}}}&lt;/includeonly&gt;&lt;noinclude&gt;Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;
{{cvar|r_somecvar|description}}
[[Category:Formatting templates]]&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1943</id>
      <timestamp>2012-07-27T10:42:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="477">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:cvar.png|link=|alt=]]&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;&lt;font style=&quot;font-weight:bold;&quot;&gt;{{{1}}}&lt;/font&gt; : {{{2}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;

{{cvar|r_somecvar|description}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1947</id>
      <timestamp>2012-07-27T10:43:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="471">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:cvar.png|link=|alt=]]&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&lt;font style=&quot;font-weight:bold;&quot;&gt;{{{1}}}&lt;/font&gt; : {{{2}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;

{{cvar|r_somecvar|description}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2958</id>
      <timestamp>2012-11-29T21:28:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="468">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:cvar.png|link=|alt=]]&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&lt;font style=&quot;font-weight:bold;&quot;&gt;{{{1}}}&lt;/font&gt; : {{{2}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template to post cvars in the article text.
 &lt;nowiki&gt;{{cvar|r_somecvar|description}}&lt;/nowiki&gt;

{{cvar|r_somecvar|description}}

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Design</title>
    <ns>10</ns>
    <id>150</id>
      <sha1>36qc2wp4monwozh7tyfnqbk9gdivmh7</sha1>
    <revision>
      <id>1828</id>
      <timestamp>2012-07-26T14:29:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.pn...&quot;</comment>
      <text xml:space="preserve" bytes="482">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1829</id>
      <timestamp>2012-07-26T14:30:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="490">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.png|link=|alt=]] Design Note:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1830</id>
      <timestamp>2012-07-26T14:30:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="503">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap;color:yellow&quot;&gt;[[File:designtip.png|link=|alt=]] Design Note:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1831</id>
      <timestamp>2012-07-26T14:31:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.png|link=|alt=]] Design Note:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1832</id>
      <timestamp>2012-07-26T14:32:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="493">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight: bolder;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.png|link=|alt=]] Design Note:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1833</id>
      <timestamp>2012-07-26T14:32:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="491">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight: bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.png|link=|alt=]] Design Note:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1839</id>
      <timestamp>2012-07-26T14:38:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="479">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight: bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:designtip.png|link=|alt=]] &lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1854</id>
      <timestamp>2012-07-26T16:36:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="459">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight: bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:tip.png|link=|alt=]] &lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1938</id>
      <timestamp>2012-07-27T10:38:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="461">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight: bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;[[File:tip.png|link=|alt=]] &lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to post a design-specific note.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;design|some design note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{design|some design note}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Entity common fields</title>
    <ns>10</ns>
    <id>78</id>
    <redirect title="Template:Entity fields common" />
      <sha1>s9tq2xz5074fnscoij3u0cbknv4hm6s</sha1>
    <revision>
      <id>782</id>
      <timestamp>2012-07-16T08:53:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX moved page [[Template:Entity common fields]] to [[Template:Entity fields common]]</comment>
      <text xml:space="preserve" bytes="43">#REDIRECT [[Template:Entity fields common]]</text>
    </revision>
  </page>
  <page>
    <title>Template:Entity fields</title>
    <ns>10</ns>
    <id>79</id>
    <redirect title="Template:Entity fields begin" />
      <sha1>2nlcel22ddgvu4j59mrnsuejwk0fbge</sha1>
    <revision>
      <id>786</id>
      <timestamp>2012-07-16T08:54:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX moved page [[Template:Entity fields]] to [[Template:Entity fields begin]]</comment>
      <text xml:space="preserve" bytes="42">#REDIRECT [[Template:Entity fields begin]]</text>
    </revision>
  </page>
  <page>
    <title>Template:Entity fields begin</title>
    <ns>10</ns>
    <id>27</id>
      <sha1>1w1tielw2t6wk32o1p1c275q2sqxx9o</sha1>
    <revision>
      <id>320</id>
      <timestamp>2012-07-03T22:18:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;== Entity fields ==  {| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot; ! width=10% | Key ! width=10% | Name ! width=70% | Description ! width=10% | Def...&quot;</comment>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>321</id>
      <timestamp>2012-07-03T22:19:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Entity fields caption]] to [[Template:Entity fields table]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>322</id>
      <timestamp>2012-07-03T22:19:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Entity fields table]] to [[Template:Entity fields]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>345</id>
      <timestamp>2012-07-03T22:37:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=3 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>346</id>
      <timestamp>2012-07-03T22:38:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>347</id>
      <timestamp>2012-07-03T22:38:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=10% | Name
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>364</id>
      <timestamp>2012-07-06T21:04:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="185">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value</text>
    </revision>
    <revision>
      <id>425</id>
      <timestamp>2012-07-14T19:44:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="219">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value

[[Category:BloodWiki:Templates]]</text>
    </revision>
    <revision>
      <id>426</id>
      <timestamp>2012-07-14T19:44:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="209">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value

[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>427</id>
      <timestamp>2012-07-14T19:45:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="219">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value

[[Category:BloodWiki:Templates]]</text>
    </revision>
    <revision>
      <id>435</id>
      <timestamp>2012-07-14T19:50:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="243">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
&lt;noinclude&gt;
[[Category:BloodWiki:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>436</id>
      <timestamp>2012-07-14T19:50:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="233">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>594</id>
      <timestamp>2012-07-15T00:11:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="297">== Entity fields ==

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value
&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>601</id>
      <timestamp>2012-07-15T00:18:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="590">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | Entity key #1
 | keyname
 | description
 |-
 | Entity key #2
 | keyname
 | description
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields_end&lt;nowiki&gt;}}&lt;/nowiki&gt;


[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>602</id>
      <timestamp>2012-07-15T00:19:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="650">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields_end&lt;nowiki&gt;}}&lt;/nowiki&gt;


[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>609</id>
      <timestamp>2012-07-15T00:27:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="875">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields_end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity_fields}}
 |-
 | '''''Health'''''
 | '''''health'''''
 | '''''Starting health of a monster'''''
 |-
 | '''''Death form'''''
 | '''''deadflag'''''
 | '''''Monster already dead'''''
 {{entity_fields_end}}

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>610</id>
      <timestamp>2012-07-15T00:27:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="815">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity_fields_end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity_fields}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity_fields_end}}

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>771</id>
      <timestamp>2012-07-16T08:06:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="815">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields_end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>772</id>
      <timestamp>2012-07-16T08:06:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="815">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>776</id>
      <timestamp>2012-07-16T08:23:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="822">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>785</id>
      <timestamp>2012-07-16T08:54:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Entity fields]] to [[Template:Entity fields begin]]</comment>
      <text xml:space="preserve" bytes="822">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>844</id>
      <timestamp>2012-07-16T17:04:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="834">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEDFDF | Name
! width=10% bgcolor=#EEDFDF | Key
! width=70% bgcolor=#EEDFDF | Description
! width=10% bgcolor=#EEDFDF | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields begin&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields begin}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1099</id>
      <timestamp>2012-07-17T22:55:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="822">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% bgcolor=#EEE | Name
! width=10% bgcolor=#EEE | Key
! width=70% bgcolor=#EEE | Description
! width=10% bgcolor=#EEE | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields begin&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields begin}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1107</id>
      <timestamp>2012-07-17T23:06:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="770">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields begin&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields begin}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2948</id>
      <timestamp>2012-11-29T21:22:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="771">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields begin&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields begin}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Special templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2953</id>
      <timestamp>2012-11-29T21:23:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="801">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields begin&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''keyname'''''
 | '''''description'''''
 |-
 | '''''Entity key #2'''''
 | '''''keyname'''''
 | '''''description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields begin}}
 |-
 | Health
 | health
 | Starting health of a monster
 |-
 | Death form
 | deadflag
 | Monster already dead
 {{entity fields end}}

[[Category:Special templates]]
[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3701</id>
      <timestamp>2014-05-15T20:48:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="735">&lt;includeonly&gt;&lt;!--
--&gt;{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Key
! width=80% | Description
! width=10% | Default value&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert entity keys block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields begin&lt;nowiki&gt;}}&lt;/nowiki&gt;
 |-
 | '''''Entity key #1'''''
 | '''''Description'''''
 |-
 | '''''Entity key #2'''''
 | '''''Description'''''
 ...
 &lt;nowiki&gt;{{&lt;/nowiki&gt;entity fields end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Example =

 {{entity fields begin}}
 |-
 | health
 | Starting health of a monster
 |-
 | deadflag
 | Death form. If set, monster spawns dead
 {{entity fields end}}

[[Category:Special templates]]
[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Entity fields end</title>
    <ns>10</ns>
    <id>28</id>
      <sha1>14h6gj11h39pn3zk4kr6r3ghszdczjo</sha1>
    <revision>
      <id>323</id>
      <timestamp>2012-07-03T22:19:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;|}&quot;</comment>
      <text xml:space="preserve" bytes="2">|}</text>
    </revision>
    <revision>
      <id>441</id>
      <timestamp>2012-07-14T19:52:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="50">|}
&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>604</id>
      <timestamp>2012-07-15T00:21:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="121">&lt;includeonly&gt;|}&lt;/includeonly&gt;&lt;noinclude&gt;
&lt;noinclude&gt;
See [[Template:entity fields]].

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>605</id>
      <timestamp>2012-07-15T00:21:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="109">&lt;includeonly&gt;|}&lt;/includeonly&gt;&lt;noinclude&gt;
See [[Template:entity fields]].

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>778</id>
      <timestamp>2012-07-16T08:51:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="116">&lt;includeonly&gt;|}&lt;/includeonly&gt;&lt;noinclude&gt;
See [[Template:entity fields]].

[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2950</id>
      <timestamp>2012-11-29T21:23:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="147">&lt;includeonly&gt;|}&lt;/includeonly&gt;&lt;noinclude&gt;
See [[Template:entity fields]].

[[Category:Special templates]]
[[Category:Entity templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Finished</title>
    <ns>10</ns>
    <id>183</id>
      <sha1>dqzyp83zwv0ve0tra2qsittsmd3b7u5</sha1>
    <revision>
      <id>2199</id>
      <timestamp>2012-07-30T05:39:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;[[Category:Finished pages]]&lt;/includeonly&gt;&lt;noinclude&gt;Mark this page as finished so it will appear in &quot;Recent pages&quot;.   &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;  [[Category:Pa...&quot;</comment>
      <text xml:space="preserve" bytes="198">&lt;includeonly&gt;[[Category:Finished pages]]&lt;/includeonly&gt;&lt;noinclude&gt;Mark this page as finished so it will appear in &quot;Recent pages&quot;.

 &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2200</id>
      <timestamp>2012-07-30T05:39:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="200">&lt;includeonly&gt;[[Category:Finished pages]]&lt;/includeonly&gt;&lt;noinclude&gt;Marking a page as finished will make it appear in &quot;Recent pages&quot;.

 &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2201</id>
      <timestamp>2012-07-30T05:40:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="227">&lt;includeonly&gt;[[Category:Finished pages]]&lt;/includeonly&gt;&lt;noinclude&gt;Marking a page as finished will make it appear in [[BloodWiki:Recent_pages | Recent pages]].

 &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2266</id>
      <timestamp>2012-07-30T20:34:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="226">&lt;includeonly&gt;[[Category:Finished pages]]&lt;/includeonly&gt;&lt;noinclude&gt;Marking a page as finished will make it appear in [[BloodWiki:RecentPages | Recent pages]].

 &lt;nowiki&gt;{{finished}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Grammar</title>
    <ns>10</ns>
    <id>180</id>
      <sha1>qe4vtne5vkllhfibs9aeynk7smrwisn</sha1>
    <revision>
      <id>2166</id>
      <timestamp>2012-07-29T20:53:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{messagebox |text=This page may contain bad grammar |small=You can help by checking and fixing it |picture=[[File:PageBadGrammar.png|36px|alt=|link]] |border=#97...&quot;</comment>
      <text xml:space="preserve" bytes="829">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Unfinished pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{bad grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2167</id>
      <timestamp>2012-07-29T20:54:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="826">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{bad grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2168</id>
      <timestamp>2012-07-29T20:54:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Bad grammar]] to [[Template:Check grammar]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="826">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{bad grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2169</id>
      <timestamp>2012-07-29T20:54:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="828">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{check grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2170</id>
      <timestamp>2012-07-29T20:54:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="822">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2171</id>
      <timestamp>2012-07-29T20:54:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Check grammar]] to [[Template:Grammar]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="822">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2382</id>
      <timestamp>2012-08-02T16:32:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="193">&lt;includeonly&gt;[[Category:Grammar checked]]&lt;/includeonly&gt;&lt;noinclude&gt;
Once checked grammar on a page, mark it with this template.

Usage:
 &lt;nowiki&gt;{{grammar checked|usename}}&lt;/nowiki&gt;
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2383</id>
      <timestamp>2012-08-02T16:33:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="218">&lt;includeonly&gt;[[Category:Grammar checked]]&lt;/includeonly&gt;&lt;noinclude&gt;
Once checked grammar on a page, mark it with this template.

Usage:
 &lt;nowiki&gt;{{grammar checked|usename}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2384</id>
      <timestamp>2012-08-02T16:33:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="822">&lt;includeonly&gt;{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2621</id>
      <timestamp>2012-08-09T20:28:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="832">&lt;includeonly&gt;&lt;--- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} ---&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2622</id>
      <timestamp>2012-08-09T20:30:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="831">&lt;includeonly&gt;&lt;!-- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} --&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2623</id>
      <timestamp>2012-08-09T20:31:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="839">&lt;includeonly&gt;&lt;!-- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} --&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;
&lt;!--
Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
--&gt;
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2699</id>
      <timestamp>2012-09-28T13:20:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="863">&lt;includeonly&gt;&lt;!-- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} --&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;
&lt;!--
Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
--&gt;
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2704</id>
      <timestamp>2012-09-28T13:27:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Grammar]] to [[Template:Grammar2]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="863">&lt;includeonly&gt;&lt;!-- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} --&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;
&lt;!--
Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
--&gt;
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2705</id>
      <timestamp>2012-09-28T13:27:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Grammar2]] to [[Template:Grammar]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="863">&lt;includeonly&gt;&lt;!-- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} --&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;
&lt;!--
Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
--&gt;
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2706</id>
      <timestamp>2012-09-28T13:28:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="891">&lt;includeonly&gt;&lt;!-- {{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Check grammar
}} --&gt;
[[Category:Check grammar]]
&lt;/includeonly&gt;&lt;noinclude&gt;
Blood Omnicide Wiki is written by a people who may not know english well. To assist page checking and fixing typos &amp; errors, this mark was added.

Using this template will allow pages to show up in &quot;Check grammar&quot; section on [[BloodWiki:Community portal | Community Portal]].

If you have checked the page and it's ok, you can remove this mark.

Usage:
 &lt;nowiki&gt;{{grammar}}&lt;/nowiki&gt;
&lt;!--
Preview:
{{messagebox
|text=This page may contain bad grammar
|small=You can help by checking and fixing it
|picture=[[File:PageBadGrammar.png|36px|alt=|link]]
|border=#975
|category=Page marks
}}
--&gt;
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Grammar checked</title>
    <ns>10</ns>
    <id>203</id>
      <sha1>4mkbrlw6kxdfimywgq0qo7wherds7bg</sha1>
    <revision>
      <id>2385</id>
      <timestamp>2012-08-02T16:34:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;[[Category:Grammar checked]]&lt;/includeonly&gt;&lt;noinclude&gt; Once checked grammar on a page, mark it with this template.  Usage:  &lt;nowiki&gt;{{grammar checked|usename}}&lt;/no...&quot;</comment>
      <text xml:space="preserve" bytes="218">&lt;includeonly&gt;[[Category:Grammar checked]]&lt;/includeonly&gt;&lt;noinclude&gt;
Once checked grammar on a page, mark it with this template.

Usage:
 &lt;nowiki&gt;{{grammar checked|usename}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2698</id>
      <timestamp>2012-09-28T13:14:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="219">&lt;includeonly&gt;[[Category:Grammar checked]]&lt;/includeonly&gt;&lt;noinclude&gt;
Once checked grammar on a page, mark it with this template.

Usage:
 &lt;nowiki&gt;{{grammar checked|username}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Hidden begin</title>
    <ns>10</ns>
    <id>60</id>
      <sha1>5g9zu2u7b9nve310vxs5v08yth94y49</sha1>
    <revision>
      <id>511</id>
      <timestamp>2012-07-14T22:55:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;!-- --&gt;{{#ifeq:{{{toggle|}}}|left    | &lt;!------------------------------------------------------------        toggle=left, so format [hide/show] link on lefthand ...&quot;</comment>
      <text xml:space="preserve" bytes="1705">&lt;includeonly&gt;&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}&lt;/includeonly&gt;&lt;noinclude&gt;&lt;!--


--&gt;{{documentation}}
&lt;!--- Please add metadata to the &lt;includeonly&gt; section at the bottom of Template:Hidden begin-end/doc ---&gt;
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>512</id>
      <timestamp>2012-07-14T22:56:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1547">&lt;includeonly&gt;&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}&lt;/includeonly&gt;</text>
    </revision>
    <revision>
      <id>515</id>
      <timestamp>2012-07-14T22:57:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1598">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;

&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>546</id>
      <timestamp>2012-07-14T23:34:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1594">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;

&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>547</id>
      <timestamp>2012-07-14T23:36:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1773">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;

&lt;noinclude&gt;
= Syntax =
 {{Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 }}
&lt;!-- content --&gt;
{{Hidden end}}


[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>548</id>
      <timestamp>2012-07-14T23:36:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1808">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;

&lt;noinclude&gt;
= Syntax =

 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 &lt;nowiki&gt;}}&lt;/nowiki&gt;
&lt;!-- content --&gt;
{{Hidden end}}


[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>549</id>
      <timestamp>2012-07-14T23:38:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1879">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;

&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =

 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>550</id>
      <timestamp>2012-07-14T23:38:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1878">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =

 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>551</id>
      <timestamp>2012-07-14T23:39:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1877">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>552</id>
      <timestamp>2012-07-14T23:39:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Hidden Begin]] to [[Template:Hidden begin]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="1877">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>555</id>
      <timestamp>2012-07-14T23:40:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1878">&lt;includeonly&gt;
&lt;!--
--&gt;{{#ifeq:{{{toggle|}}}|left
   | &lt;!------------------------------------------------------------
       toggle=left, so format [hide/show] link on lefthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;width:100%; position:relative; border:{{{border|1}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;width:2.8em; background:transparent; position:absolute;&quot;&gt;&lt;/div&gt;&lt;!--
          --&gt;&lt;div style=&quot;height:1.6em; background:transparent; text-align:left; padding-left:2.3em; font-size:100%; font-weight:bold; {{{titlestyle|}}}&quot;&gt;&lt;!--
              --&gt;&amp;nbsp;&amp;nbsp;&lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt;{{{title|}}}&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;text-align:left; padding-left:0.3em; {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;| &lt;!------------------------------------------------------------
       toggle/=left, so format [hide/show] link on righthand side:
      -------------------------------------------------------------
      --&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot; style=&quot;border:{{{border|none}}};&quot;&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavHead&quot; style=&quot;background:{{{bg1|transparent}}}; text-align:{{{ta1|left}}}; {{{extra1|}}} {{{titlestyle|}}}&quot;&gt;&lt;!--
                  &lt;!--(deprecated:)--&gt;{{{header|}}}&lt;!----&gt; {{{title|}}}&amp;nbsp;&lt;/div&gt;&lt;!--
          --&gt;&lt;div class=&quot;NavContent&quot; style=&quot;background:{{{bg2|transparent}}}; text-align:{{{ta2|left}}}; {{{extra2|}}} {{{bodystyle|}}}&quot;&gt;&lt;!--

--&gt;}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |toggle=
 |border=
 |header=
 |title=
 |titlestyle=
 |bodystyle=
 |bg1=
 |bg2=
 |ta1=
 |ta2=
 |extra1=
 |extra2=
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>556</id>
      <timestamp>2012-07-14T23:43:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="458">&lt;includeonly&gt;
&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;
&lt;div class=&quot;NavHead&quot;&gt;{{{title|{{{1}}}}}}&lt;/div&gt;
&lt;div class=&quot;NavContent&quot;&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>566</id>
      <timestamp>2012-07-14T23:51:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="464">&lt;includeonly&gt;
&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;
&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&lt;/div&gt;
&lt;div class=&quot;NavContent&quot;&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>576</id>
      <timestamp>2012-07-15T00:02:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="476">&lt;includeonly&gt;
&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;
&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;NavContent&quot;&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>579</id>
      <timestamp>2012-07-15T00:04:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="490">&lt;includeonly&gt;
&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;!--
--&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;!--
--&gt;&lt;div class=&quot;NavContent&quot;&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>580</id>
      <timestamp>2012-07-15T00:05:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="472">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;
&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>581</id>
      <timestamp>2012-07-15T00:06:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="172">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;</text>
    </revision>
    <revision>
      <id>582</id>
      <timestamp>2012-07-15T00:06:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="471">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{hidden end }} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>588</id>
      <timestamp>2012-07-15T00:09:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="514">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end | hidden end]] &lt;nowiki&gt;}} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>589</id>
      <timestamp>2012-07-15T00:10:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="512">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]] &lt;nowiki&gt;}} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>590</id>
      <timestamp>2012-07-15T00:10:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="511">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
= How to use =
 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>591</id>
      <timestamp>2012-07-15T00:10:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="511">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Hidden block.

 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>592</id>
      <timestamp>2012-07-15T00:10:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="552">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{hidden begin | Block Caption }} &lt;/nowiki&gt;
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>595</id>
      <timestamp>2012-07-15T00:13:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="576">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{hidden begin | ''Block Caption'' }} &lt;/nowiki&gt;
 ''Block Contents''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}} &lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>596</id>
      <timestamp>2012-07-15T00:13:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="588">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|''Block Caption''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 ''Block Contents''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>597</id>
      <timestamp>2012-07-15T00:13:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="600">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Syntax =
 &lt;nowiki&gt;{{&lt;/nowiki&gt;Hidden begin
 |title=Title of hidden block
 |expanded=Whether to show hidden block as expanded
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>598</id>
      <timestamp>2012-07-15T00:14:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="532">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Advanced parameters =
 * expanded = Whether to show hidden block as expanded

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>599</id>
      <timestamp>2012-07-15T00:14:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="529">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;[[Template:hidden end|hidden end]]&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Advanced parameters =
* expanded=Whether to show hidden block as expanded

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>603</id>
      <timestamp>2012-07-15T00:20:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="505">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Advanced parameters =
* expanded=Whether to show hidden block as expanded

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>611</id>
      <timestamp>2012-07-15T00:29:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="590">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Advanced parameters =
* expanded=Whether to show hidden block as expanded

= Example =
 {{hidden begin | Hidden block}}
 Hidden block contents
 {{hidden end}}

[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>612</id>
      <timestamp>2012-07-15T00:29:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="592">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Advanced parameters =
* expanded=Whether to show hidden block as expanded

= Example =
 {{hidden begin | Hidden block}}
 Hidden block contents
 {{hidden end}}



[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>668</id>
      <timestamp>2012-07-15T01:48:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="603">&lt;includeonly&gt;&lt;div class=&quot;NavFrame {{#if:{{{expanded|}}}||collapsed}}&quot;&gt;&lt;div class=&quot;NavHead&quot;&gt;&amp;nbsp;{{{title|{{{1}}}}}}&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;NavContent&quot;&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
To insert hidden block use the following construction:

 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden begin|'''''Block Caption'''''&lt;nowiki&gt;}}&lt;/nowiki&gt;
 '''''Block Contents'''''
 &lt;nowiki&gt;{{&lt;/nowiki&gt;hidden end&lt;nowiki&gt;}}&lt;/nowiki&gt;

= Advanced parameters =
* expanded=Whether to show hidden block as expanded

= Example =
 {{hidden begin | Hidden block}}
 Hidden block contents
 {{hidden end}}



[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Hidden end</title>
    <ns>10</ns>
    <id>61</id>
      <sha1>6beenvuqlxgtrm6xgzuo2v0i2a1h6tp</sha1>
    <revision>
      <id>513</id>
      <timestamp>2012-07-14T22:56:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;/div&gt;&lt;/div&gt;&quot;</comment>
      <text xml:space="preserve" bytes="12">&lt;/div&gt;&lt;/div&gt;</text>
    </revision>
    <revision>
      <id>514</id>
      <timestamp>2012-07-14T22:56:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="36">&lt;/div&gt;&lt;/div&gt;

[[Category:Templates]]</text>
    </revision>
    <revision>
      <id>516</id>
      <timestamp>2012-07-14T22:57:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="90">&lt;includeonly&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;/includeonly&gt;

&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>553</id>
      <timestamp>2012-07-14T23:39:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Hidden End]] to [[Template:Hidden end]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="90">&lt;includeonly&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;/includeonly&gt;

&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>585</id>
      <timestamp>2012-07-15T00:08:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="86">&lt;includeonly&gt;&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>586</id>
      <timestamp>2012-07-15T00:09:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="134">&lt;includeonly&gt;&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
End of [[Template:hidden begin | hidden block].
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>587</id>
      <timestamp>2012-07-15T00:09:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="135">&lt;includeonly&gt;&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
End of [[Template:hidden begin | hidden block]].
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>600</id>
      <timestamp>2012-07-15T00:15:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="132">&lt;includeonly&gt;&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
See [[Template:hidden begin | hidden block]].
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>606</id>
      <timestamp>2012-07-15T00:21:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="117">&lt;includeonly&gt;&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
See [[Template:hidden begin]].
[[Category:Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>670</id>
      <timestamp>2012-07-15T01:49:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="128">&lt;includeonly&gt;&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
See [[Template:hidden begin]].
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Important</title>
    <ns>10</ns>
    <id>145</id>
      <sha1>icopsjzov6l7d29cgour6674ax0utr6</sha1>
    <revision>
      <id>1809</id>
      <timestamp>2012-07-26T13:30:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link...&quot;</comment>
      <text xml:space="preserve" bytes="416">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 {{important|some important text}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1810</id>
      <timestamp>2012-07-26T13:31:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="504">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:important.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{important|some important text}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1811</id>
      <timestamp>2012-07-26T13:31:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="505">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:important.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1812</id>
      <timestamp>2012-07-26T13:31:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="511">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:important.png|link=|alt=]] Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1813</id>
      <timestamp>2012-07-26T13:32:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="527">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:important.png|link=|alt=]] Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell;padding-top:2px&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1814</id>
      <timestamp>2012-07-26T13:32:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="528">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:important.png|link=|alt=]] Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell;padding-top:20px&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Notice templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1816</id>
      <timestamp>2012-07-26T13:34:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="530">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:important.png|link=|alt=]] Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell;padding-top:20px&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1818</id>
      <timestamp>2012-07-26T13:36:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="551">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top: -2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1819</id>
      <timestamp>2012-07-26T13:36:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="550">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

== Example ==
{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1822</id>
      <timestamp>2012-07-26T14:19:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="536">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1845</id>
      <timestamp>2012-07-26T16:32:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="516">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1852</id>
      <timestamp>2012-07-26T16:35:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="516">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1853</id>
      <timestamp>2012-07-26T16:35:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="522">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{important|some important text}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1940</id>
      <timestamp>2012-07-27T10:39:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="524">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Important:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;important|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{important|some important text}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Importante</title>
    <ns>10</ns>
    <id>613</id>
      <sha1>e1mfzyxeex9by8zy1uyo5cb5o4whmlz</sha1>
    <revision>
      <id>3438</id>
      <timestamp>2013-01-22T18:07:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:im...&quot;</comment>
      <text xml:space="preserve" bytes="533">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Importante:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;importante|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{importante|some important text}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3441</id>
      <timestamp>2013-01-22T18:08:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Importante]] to [[Template:Importante2]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="533">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Importante:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;importante|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{importante|some important text}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3442</id>
      <timestamp>2013-01-22T18:08:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Importante2]] to [[Template:Importante]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="533">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Importante:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to warn about important thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;importante|some important text&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{importante|some important text}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3444</id>
      <timestamp>2013-01-22T18:13:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="538">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Importante:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Usa questo template quando vuoi avvertire di qualcosa di importante.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;importante|una cosa importante&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{importante|una cosa importante}}

[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3446</id>
      <timestamp>2013-01-22T18:15:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="531">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;&lt;span style=&quot;margin-top:-2px&quot;&gt;[[File:important.png|link=|alt=]]&lt;/span&gt; Importante:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Usa questo template quando vuoi avvertire di qualcosa di importante.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;importante|una cosa importante&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{importante|una cosa importante}}

[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Imported</title>
    <ns>10</ns>
    <id>199</id>
      <sha1>kcp2btb9q7f2c96zyvju7ftvy7pzihw</sha1>
    <revision>
      <id>2338</id>
      <timestamp>2012-08-01T09:10:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{messagebox |text=This article was imported from external source {{#if:{{{for|}}}|and adapted for {{{for|}}}}} |small=Original [{{{source}}} article] by {{{autho...&quot;</comment>
      <text xml:space="preserve" bytes="826">&lt;includeonly&gt;{{messagebox
|text=This article was imported from external source {{#if:{{{for|}}}|and adapted for {{{for|}}}}}
|small=Original [{{{source}}} article] by {{{author}}}
|picture=[[File:PageBorrowed.png|36px|alt=|link]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported
 |author=author of article
 |source=source url
 |for=thing article is adapted for (optional)
 }}&lt;/nowiki&gt;&lt;/noinclude&gt;
{{imported
|author=author of adopned article
|source=soruce article
|for=Darkplaces engine
}}</text>
    </revision>
    <revision>
      <id>2340</id>
      <timestamp>2012-08-01T09:23:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="852">&lt;includeonly&gt;{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://{{{2}}} article] by {{{1}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2341</id>
      <timestamp>2012-08-01T09:24:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="876">&lt;includeonly&gt;{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://{{{2}}} article] by {{{1}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2373</id>
      <timestamp>2012-08-01T14:21:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="869">&lt;includeonly&gt;{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [{{{2}}} article] by {{{1}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2374</id>
      <timestamp>2012-08-01T14:21:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="893">&lt;includeonly&gt;{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [&lt;nowiki&gt;http://&lt;/nowiki&gt;{{{2}}} article] by {{{1}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2376</id>
      <timestamp>2012-08-01T14:22:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="876">&lt;includeonly&gt;{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://{{{2}}} article] by {{{1}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2377</id>
      <timestamp>2012-08-01T14:23:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="873">&lt;includeonly&gt;{{messagebox
|text=This page was imported and adapted to the Blood Wiki
|small=Original [http://{{{2}}} article] by {{{1}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2462</id>
      <timestamp>2012-08-03T15:54:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="916">&lt;includeonly&gt;{{messagebox
|text=This page was imported and adapted to the Blood Wiki
|small=Original {{#if:{{{2|}}}| [http://{{{2}}} article] by {{{1}}} | article http://{{{1}}}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2463</id>
      <timestamp>2012-08-03T15:56:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="962">&lt;includeonly&gt;{{messagebox
|text=This page was imported and adapted to the Blood Wiki
|small=Original {{#if:{{{2|}}}| [http://{{{2}}} article] by {{{1}}} | article http://{{{1}}}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Or:
 &lt;nowiki&gt;{{imported|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2605</id>
      <timestamp>2012-08-09T19:23:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="979">&lt;includeonly&gt;{{messagebox
|text=This page was imported and adapted to the Blood Wiki
|small=Original {{#if:{{{2|}}}| [&lt;nowiki&gt;http://&lt;/nowiki&gt;{{{2}}} article] by {{{1}}} | article http://{{{1}}}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Or:
 &lt;nowiki&gt;{{imported|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2606</id>
      <timestamp>2012-08-09T19:24:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="955">&lt;includeonly&gt;{{messagebox
|text=This page was imported and adapted to the Blood Wiki
|small=Original {{#if:{{{2|}}}| [{{{2}}} article] by {{{1}}} | article http://{{{1}}}}}
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;This template should be used for pages that was not written originally for Blood Wiki, but was imported from another sources and adopted to the glossary of Blood Wiki. 

Dont set this mark if imported article was under free-to-share license (like wikipedia articles, official manuals etc.).

Usage:
 &lt;nowiki&gt;{{imported|author|source_url}}&lt;/nowiki&gt;
Or:
 &lt;nowiki&gt;{{imported|source_url}}&lt;/nowiki&gt;
Preview:
{{messagebox
|text=This article was imported and adapted to the Blood Wiki
|small=Original [http://source_url article] by someauthor
|picture=[[File:PageImported.png|36px|alt=|link=]]
|border=green
|category=Imported pages
}}
[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Initalian</title>
    <ns>10</ns>
    <id>593</id>
      <sha1>6kbmu8rkxwl7wtxl4qcnyb7ia8hb99j</sha1>
    <revision>
      <id>3349</id>
      <timestamp>2013-01-15T13:34:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}} ----- &amp;nbsp;[[Portal:InItalian|Blood Wiki in Italian]] &lt;/includeonly&gt;&lt;noinclude&gt; This page marker should be used only on ...&quot;</comment>
      <text xml:space="preserve" bytes="325">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InItalian|Blood Wiki in Italian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InItalian|Blood Wiki in Italian]] portal.

Usage:
 &lt;nowiki&gt;{{initalian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3435</id>
      <timestamp>2013-01-22T18:00:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="365">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InItalian|Blood Wiki in Italian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InItalian|Blood Wiki in Italian]] portal.

Usage:
 &lt;nowiki&gt;{{initalian}}&lt;/nowiki&gt;

[[Category:Page marks]]
[[Category:Portal:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3447</id>
      <timestamp>2013-01-22T18:15:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="358">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InItalian|Blood Wiki in Italian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InItalian|Blood Wiki in Italian]] portal.

Usage:
 &lt;nowiki&gt;{{initalian}}&lt;/nowiki&gt;

[[Category:Page marks]]
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3479</id>
      <timestamp>2013-01-22T19:25:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="381">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InItalian|Blood Wiki in Italian]] [[Category:InItalian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InItalian|Blood Wiki in Italian]] portal.

Usage:
 &lt;nowiki&gt;{{initalian}}&lt;/nowiki&gt;

[[Category:Page marks]]
[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3491</id>
      <timestamp>2013-01-22T22:01:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="348">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InItalian|Blood Wiki in Italian]] [[Category:InItalian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InItalian|Blood Wiki in Italian]] portal.

Usage:
 &lt;nowiki&gt;{{initalian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Inrussian</title>
    <ns>10</ns>
    <id>307</id>
      <sha1>gn64onq2oir8pitdyw1vylgwms67pob</sha1>
    <revision>
      <id>2874</id>
      <timestamp>2012-11-22T13:00:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{DISPLAYTITLE|Blood Wiki по-русски: {{PAGENAME}}}} ----- &amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]] &lt;/includeonly&gt;&lt;noinclude&gt; This page mark...&quot;</comment>
      <text xml:space="preserve" bytes="326">&lt;includeonly&gt;{{DISPLAYTITLE|Blood Wiki по-русски: {{PAGENAME}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2878</id>
      <timestamp>2012-11-22T13:03:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="351">&lt;includeonly&gt;{{DISPLAYTITLE:Blood Wiki по-русски: {{PAGENAME}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2879</id>
      <timestamp>2012-11-22T13:04:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="355">&lt;includeonly&gt;{{DISPLAYTITLE:Blood Wiki по-русски: {{BASEPAGENAME}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2880</id>
      <timestamp>2012-11-22T13:05:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="354">&lt;includeonly&gt;{{DISPLAYTITLE:Blood Wiki по-русски: {{SUBPAGENAME}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2882</id>
      <timestamp>2012-11-22T13:06:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="362">&lt;includeonly&gt;{{DISPLAYTITLE:Blood Wiki по-русски: {{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2883</id>
      <timestamp>2012-11-22T13:06:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="332">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3478</id>
      <timestamp>2013-01-22T19:24:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="355">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]] [[Category:InRussian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3484</id>
      <timestamp>2013-01-22T19:49:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="372">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]] [[Category:InRussian]] {{#language:ru}}
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3492</id>
      <timestamp>2013-01-22T22:01:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="355">&lt;includeonly&gt;{{DISPLAYTITLE:{{{1|{{SUBPAGENAME}}}}}}}
-----
&amp;nbsp;[[Portal:InRussian|Blood Wiki по-русски]] [[Category:InRussian]]
&lt;/includeonly&gt;&lt;noinclude&gt;
This page marker should be used only on pages that belongs to [[Portal:InRussian|Blood Wiki in Russian]] portal.

Usage:
 &lt;nowiki&gt;{{inrussian}}&lt;/nowiki&gt;

[[Category:Page marks]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Messagebox</title>
    <ns>10</ns>
    <id>164</id>
      <sha1>h0qngqfdxin5ldchjrovgn5ns757qii</sha1>
    <revision>
      <id>1993</id>
      <timestamp>2012-07-27T13:44:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;center&gt;&lt;div style=&quot;width:600px;border: 1px {{{border|white}}} solid;border-left-width:5px;padding:4px;margin:6px;background-color: {{{bg|#fffff7}}}&quot;&gt; &lt;div style=&quot;display:tabl...&quot;</comment>
      <text xml:space="preserve" bytes="1242">&lt;center&gt;&lt;div style=&quot;width:600px;border: 1px {{{border|white}}} solid;border-left-width:5px;padding:4px;margin:6px;background-color: {{{bg|#fffff7}}}&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-right:4px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>1994</id>
      <timestamp>2012-07-27T13:45:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1250">&lt;center&gt;&lt;div style=&quot;width:600px;border: 1px {{{border|white}}} solid;border-left-width:5px;padding:4px;margin:6px;background-color: {{{bg|#fffff7}}}&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-right:4px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>2029</id>
      <timestamp>2012-07-27T14:46:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1267">&lt;center&gt;&lt;div style=&quot;width:600px;border: 1px {{{border|white}}} solid;border-left-width:5px;padding:4px;margin:6px;background-color: {{{bg|#fffff7}}}&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-left:4px;padding-right:8px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>2149</id>
      <timestamp>2012-07-29T13:54:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1278">&lt;center&gt;&lt;div style=&quot;width:450px;border: 1px {{{border|white}}} solid;border-left-width:5px;padding:4px;margin:6px;background-color:{{{bg|#fffff7}}};float:right&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-left:4px;padding-right:8px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>2150</id>
      <timestamp>2012-07-29T13:58:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1290">&lt;center&gt;&lt;div style=&quot;width:450px;border: 1px {{{border|white}}} solid;border-left-width:7px;padding:4px;margin:4px;background-color:{{{bg|#fffff7}}};float:right;clear:right&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-left:4px;padding-right:8px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>2151</id>
      <timestamp>2012-07-29T13:59:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1294">&lt;center&gt;&lt;div style=&quot;min-width:450px;border: 1px {{{border|white}}} solid;border-left-width:7px;padding:4px;margin:4px;background-color:{{{bg|#fffff7}}};float:right;clear:right&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-left:4px;padding-right:8px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>2152</id>
      <timestamp>2012-07-29T14:00:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1290">&lt;center&gt;&lt;div style=&quot;width:450px;border: 1px {{{border|white}}} solid;border-left-width:7px;padding:4px;margin:4px;background-color:{{{bg|#fffff7}}};float:right;clear:right&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-left:4px;padding-right:8px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
    <revision>
      <id>2153</id>
      <timestamp>2012-07-29T14:00:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1294">&lt;center&gt;&lt;div style=&quot;max-width:450px;border: 1px {{{border|white}}} solid;border-left-width:7px;padding:4px;margin:4px;background-color:{{{bg|#fffff7}}};float:right;clear:right&quot;&gt;
&lt;div style=&quot;display:table-cell;padding-left:4px;padding-right:8px;&quot;&gt;{{{picture|}}}&lt;/div&gt;
&lt;div style=&quot;width:100%;text-align:left;vertical-align:middle;display:table-cell;color:{{{color|black}}}&quot;&gt;&lt;font style=&quot;font-weight:bold&quot;&gt;{{{text|}}}&lt;/font&gt;{{#if: {{{small|}}} |&lt;br&gt;&lt;font size=1&gt;{{{small}}}&lt;/font&gt;}}&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;
{{#if: {{{category|}}} | [[Category:{{{category}}}]]}}&lt;noinclude&gt;
Use this template to place message boxes on a page.

Usage:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 | text = Message text
 | small = Small message text (optional)
 | picture = picture (optional)
 | color = textcolor (optional)
 | border = border color
 | bg = background color (optional)
 | category = page categoty (optional)
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Example:
 &lt;nowiki&gt;{{messagebox&lt;/nowiki&gt;
 |text=Alert
 |small=Small alert message
 |picture=&lt;nowiki&gt;[[File:important.png|alt=|link=]]&lt;/nowiki&gt;
 |color=black
 |border=gray
 |bg=#ffffff9
 &lt;nowiki&gt;}}&lt;/nowiki&gt;

Result:
{{messagebox
|text=Alert
|small=Small alert message
|picture=[[File:important.png|alt=|link=]]
|color=black
|border=gray
|bg=#ffffff9
}}

[[Category: Formatting templates]]</text>
    </revision>
  </page>
  <page>
    <title>Template:Navigation footer</title>
    <ns>10</ns>
    <id>177</id>
      <sha1>pm2ikou7vx8mfwd0v0gdodrypapsny3</sha1>
    <revision>
      <id>2063</id>
      <timestamp>2012-07-27T18:47:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;br&gt; ---- &lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt; [[{{{1|}}} | Back to index]]&lt;/includeonly&gt;&lt;noinclude&gt; This template will set a fo...&quot;</comment>
      <text xml:space="preserve" bytes="367">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{{1|}}} | Back to index]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2067</id>
      <timestamp>2012-07-27T18:55:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="421">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{{1|}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[{{PAGENAME}} | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2068</id>
      <timestamp>2012-07-27T18:56:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="422">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{{1|}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[{{PAGENAME}}# | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2069</id>
      <timestamp>2012-07-27T18:56:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="427">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{{1|}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[{{{1|}}}/{{{2|}}}# | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2070</id>
      <timestamp>2012-07-27T18:56:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="410">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{{1|}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[# | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2071</id>
      <timestamp>2012-07-27T18:59:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="413">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{{1|}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[#top | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2076</id>
      <timestamp>2012-07-27T19:16:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="569">&lt;includeonly&gt;&lt;br&gt;
----
&lt;font size=3&gt;Next chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]&lt;/font&gt;&lt;br&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[#top | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Next_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2083</id>
      <timestamp>2012-07-27T19:22:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="589">&lt;includeonly&gt;&lt;br&gt;
----
{{#if: {{{1|}}} | &lt;font size=3&gt;Next chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]&lt;/font&gt;&lt;br&gt;}}
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}} | Back to index]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[#top | Top of the page]]&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a footage navigation block showing &quot;back to index&quot; link and next chapter.

 &lt;nowiki&gt;{{navigation footer|Next_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Navigation title</title>
    <ns>10</ns>
    <id>129</id>
      <sha1>n8bda7wac7wmzp2gj9zjd0vtx44zo0h</sha1>
    <revision>
      <id>1527</id>
      <timestamp>2012-07-23T06:29:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt; &lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt; {| cellspacing=0 cellpadding=5 wid...&quot;</comment>
      <text xml:space="preserve" bytes="630">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=5 width=100%
| colspan=4 | {{{index|{{{1}}}}}}
|-
| width=43% align=right  | &lt;font size=2&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center | &lt;font size=2&gt;[[{{{index|{{{1}}}}}} | Index]]&lt;/font&gt;
| width=43% align=left   | &lt;font size=2&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1529</id>
      <timestamp>2012-07-23T06:30:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="708">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=5 width=100%
| colspan=4 | {{{index|{{{1}}}}}}
|-
| width=43% align=right  | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}} | Index]]&lt;/font&gt;
| width=43% align=left   | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1530</id>
      <timestamp>2012-07-23T06:31:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="732">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% height=20 align=right valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% height=20 align=center valign=top   | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% height=20 align=left valign=bottom  | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1531</id>
      <timestamp>2012-07-23T06:32:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="735">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% height=20 align=right  valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% height=20 align=center valign=top    | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% height=20 align=left   valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1532</id>
      <timestamp>2012-07-23T06:33:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="804">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% height=20 align=right  valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% height=20 align=center valign=top    | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% height=20 align=left   valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1533</id>
      <timestamp>2012-07-23T06:33:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="804">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% height=25 align=right  valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% height=25 align=center valign=top    | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% height=25 align=left   valign=bottom | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1534</id>
      <timestamp>2012-07-23T06:34:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="807">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% align=right  style=&quot;padding-top: 10px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 10px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1535</id>
      <timestamp>2012-07-23T06:34:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="807">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% align=right  style=&quot;padding-top: 16px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 16px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1536</id>
      <timestamp>2012-07-23T06:34:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="807">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1537</id>
      <timestamp>2012-07-23T06:34:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="807">&lt;includeonly&gt;
&lt;div style=&quot;padding: 2px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:10px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1538</id>
      <timestamp>2012-07-23T06:35:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="806">&lt;includeonly&gt;
&lt;div style=&quot;padding: 2px; background-color: #eee; border: 3px solid #aaa;clear:both; text-align: center; margin-bottom:3px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1539</id>
      <timestamp>2012-07-23T06:35:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="806">&lt;includeonly&gt;
&lt;div style=&quot;padding: 2px; background-color: #eee; border: 2px solid #aaa;clear:both; text-align: center; margin-bottom:3px;&quot;&gt;
{| cellspacing=0 cellpadding=2 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1540</id>
      <timestamp>2012-07-23T06:35:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="806">&lt;includeonly&gt;
&lt;div style=&quot;padding: 2px; background-color: #eee; border: 2px solid #aaa;clear:both; text-align: center; margin-bottom:3px;&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1541</id>
      <timestamp>2012-07-23T06:35:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 2px solid #aaa;clear:both;&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1542</id>
      <timestamp>2012-07-23T06:36:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa;clear:both;&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100%
| width=43% align=right  style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1543</id>
      <timestamp>2012-07-23T06:37:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="800">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa;clear:both;&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100%
| width=43% align=right  valign=top style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                          | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 25px&quot;| &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1544</id>
      <timestamp>2012-07-23T06:37:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="803">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa;clear:both;&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100%
| width=43% align=right  valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1545</id>
      <timestamp>2012-07-23T06:38:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="802">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa;clear:both&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100%
| width=43% align=right  valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1546</id>
      <timestamp>2012-07-23T06:38:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="812">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa;clear:both&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 
| width=43% align=right  valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]

{{navigation | Navigation book index | Previous page | Next page}}

&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1547</id>
      <timestamp>2012-07-23T06:39:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="810">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa;clear:both&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 
| width=43% align=right  valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1548</id>
      <timestamp>2012-07-23T06:39:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="817">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 25px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1549</id>
      <timestamp>2012-07-23T06:39:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="817">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 16px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 16px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1550</id>
      <timestamp>2012-07-23T06:40:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="817">&lt;includeonly&gt;
&lt;div style=&quot;padding: 0px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1551</id>
      <timestamp>2012-07-23T06:40:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="817">&lt;includeonly&gt;
&lt;div style=&quot;padding: 5px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1552</id>
      <timestamp>2012-07-23T06:40:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="817">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% border=1 style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1553</id>
      <timestamp>2012-07-23T06:40:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="808">&lt;includeonly&gt;
&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;
&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1554</id>
      <timestamp>2012-07-23T06:41:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="806">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]
{{navigation | Navigation book index | Previous page | Next page}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1555</id>
      <timestamp>2012-07-23T06:41:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="804">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1556</id>
      <timestamp>2012-07-23T06:43:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="778">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{prev|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{prev|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2&gt;[[{{{index|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{index|{{{1}}}}}}/{{{next|{{{3}}}}}} | {{{next|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1559</id>
      <timestamp>2012-07-23T06:44:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="754">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1560</id>
      <timestamp>2012-07-23T06:50:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="788">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| colspan=3 | Navigation panel
|-
| width=43% align=right  valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top                           | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top style=&quot;padding-top: 12px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1561</id>
      <timestamp>2012-07-23T06:51:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="710">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| colspan=3 | Navigation panel
|-
| width=43% align=right  valign=top | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center valign=top | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   valign=top | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1562</id>
      <timestamp>2012-07-23T06:51:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="690">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| colspan=3 align=center | Navigation panel
|-
| width=43% align=right  | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1563</id>
      <timestamp>2012-07-23T06:52:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="765">&lt;includeonly&gt;&lt;div style=&quot;padding: 7px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| colspan=3 align=center | Navigation panel
|-
| width=43% align=right  style=&quot;padding-top: 7px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center style=&quot;padding-top: 0px&quot; | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 7px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1564</id>
      <timestamp>2012-07-23T06:52:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| colspan=3 align=center | Navigation panel
|-
| width=43% align=right  style=&quot;padding-top: 10px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center style=&quot;padding-top: 0px&quot; | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 10px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1565</id>
      <timestamp>2012-07-23T06:53:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| colspan=3 align=center | Navigation Panel
|-
| width=43% align=right  style=&quot;padding-top: 10px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
| width=14% align=center style=&quot;padding-top: 0px&quot; | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
| width=43% align=left   style=&quot;padding-top: 10px&quot; | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1566</id>
      <timestamp>2012-07-23T06:54:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="710">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right  | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation Panel
| rowspan=2 width=43% align=left   | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1567</id>
      <timestamp>2012-07-23T06:54:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="736">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation Panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1568</id>
      <timestamp>2012-07-23T06:55:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="736">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1569</id>
      <timestamp>2012-07-23T06:56:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="766">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
== Usage ==
 {{navigation | Darkplaces material system | p=Previous chapter| n=Next chapter}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1570</id>
      <timestamp>2012-07-23T06:57:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="783">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
== Usage ==
 &lt;nowiki&gt;{{navigation | Darkplaces material system | p=Previous chapter| n=Next chapter}}&lt;/nowiki&gt;
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1571</id>
      <timestamp>2012-07-23T06:58:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="881">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
== Usage ==
 &lt;nowiki&gt;{{navigation | Index chapter | p=Previous chapter| n=Next chapter}}&lt;/nowiki&gt;
This will generate links to:
 * Index chapter
 * Index chapter/Previous chapter
 * Index chapter/Next chapter

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1572</id>
      <timestamp>2012-07-23T06:58:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="878">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
== Usage ==
 &lt;nowiki&gt;{{navigation | Index chapter | p=Previous chapter| n=Next chapter}}&lt;/nowiki&gt;
This will generate links to:
* Index chapter/Previous chapter
* Index chapter
* Index chapter/Next chapter

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1573</id>
      <timestamp>2012-07-23T06:58:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="879">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
== Usage ==
 &lt;nowiki&gt;{{navigation | Index chapter | p=Previous chapter | n=Next chapter}}&lt;/nowiki&gt;
This will generate links to:
* Index chapter/Previous chapter
* Index chapter
* Index chapter/Next chapter

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1574</id>
      <timestamp>2012-07-23T08:10:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="736">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1576</id>
      <timestamp>2012-07-23T08:17:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="747">&lt;includeonly&gt;&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;__NOTITLE__&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1578</id>
      <timestamp>2012-07-23T08:28:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="798">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;__NOTITLE__&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1579</id>
      <timestamp>2012-07-23T08:28:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="787">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;[[Category:Formatting templates]]{{navigation | Navigation book index | Previous page | Next page}}&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1580</id>
      <timestamp>2012-07-23T08:30:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="909">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | Previous page | Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1581</id>
      <timestamp>2012-07-23T08:30:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="910">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | Previous page | Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1582</id>
      <timestamp>2012-07-23T08:30:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="914">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1583</id>
      <timestamp>2012-07-23T08:32:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="968">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | {{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
|           width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left  valign=middle | {{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1584</id>
      <timestamp>2012-07-23T08:35:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1045">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=43% | width=1%}} align=right valign=middle | {{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
|           width=14% align=center | Navigation panel
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=83% | width=83%}} align=left  valign=middle | {{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1585</id>
      <timestamp>2012-07-23T08:36:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1038">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=43% | width=1%}} align=right valign=middle | 
 {{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
| width=14% align=center | Navigation panel
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=83% | width=83%}} align=left valign=middle | 
 {{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1586</id>
      <timestamp>2012-07-23T08:36:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1036">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=43% | width=1%}} align=right valign=middle | 
{{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
| width=14% align=center | Navigation panel
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=83% | width=83%}} align=left valign=middle | 
{{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center | &lt;font size=2&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1587</id>
      <timestamp>2012-07-23T08:37:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1036">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=43% | width=1%}} align=right valign=middle | 
{{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
| width=14% align=center | Navigation panel
| rowspan=2 {{#if: {{{p|{{{2}}}}}} | width=83% | width=83%}} align=left valign=middle | 
{{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center | &lt;font size=3&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1588</id>
      <timestamp>2012-07-23T08:37:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="959">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | 
{{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
| width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left valign=middle | 
{{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center | &lt;font size=3&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1589</id>
      <timestamp>2012-07-23T08:38:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1007">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=43% align=right valign=middle | 
{{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
| width=14% align=center | Navigation panel
| rowspan=2 width=43% align=left valign=middle | 
{{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center style=&quot;padding-left: 20px; padding-right: 20px&quot; | &lt;font size=3&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1590</id>
      <timestamp>2012-07-23T08:39:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1007">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
{| cellspacing=0 cellpadding=0 width=100% style=&quot;margin:0px&quot;
| rowspan=2 width=40% align=right valign=middle | 
{{#if: {{{p|{{{2}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{p|{{{2}}}}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p|{{{2}}}}}}]]&lt;/font&gt;}}
| width=20% align=center | Navigation panel
| rowspan=2 width=40% align=left valign=middle | 
{{#if: {{{n|{{{3}}}}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{i|{{{1}}}}}}/{{{n|{{{3}}}}}} | {{{n|{{{3}}}}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt;}}
|-
| align=center style=&quot;padding-left: 20px; padding-right: 20px&quot; | &lt;font size=3&gt;[[{{{i|{{{1}}}}}}]]&lt;/font&gt;
|}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1609</id>
      <timestamp>2012-07-23T09:00:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="757">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1610</id>
      <timestamp>2012-07-23T09:01:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="757">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;div style=&quot;padding: 4px; background-color: #eee; border: 1px solid #aaa; margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1611</id>
      <timestamp>2012-07-23T09:02:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="666">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;h1&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
&lt;/h1&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1612</id>
      <timestamp>2012-07-23T09:03:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="663">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;h1&gt;&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/h1&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1613</id>
      <timestamp>2012-07-23T09:03:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="666">&lt;includeonly&gt;
{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;h1&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/h1&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1614</id>
      <timestamp>2012-07-23T09:04:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="677">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;/includeonly&gt;&lt;h1&gt;&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/h1&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1615</id>
      <timestamp>2012-07-23T09:04:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="670">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;h1&gt;&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/h1&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1616</id>
      <timestamp>2012-07-23T09:05:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="672">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div&gt;&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1617</id>
      <timestamp>2012-07-23T09:06:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="666">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;div&gt;&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/span&gt;}}__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1618</id>
      <timestamp>2012-07-23T09:06:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="620">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }} {{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}}}&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1619</id>
      <timestamp>2012-07-23T09:08:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="625">&lt;includeonly&gt;
{{DISPLAYTITLE:&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1620</id>
      <timestamp>2012-07-23T09:08:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="638">&lt;includeonly&gt;
{{DISPLAYTITLE:&lt;font size=4&gt;&lt;wiki&gt;[[{{{1}}}]] / {{{2}}}&lt;/wiki&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1621</id>
      <timestamp>2012-07-23T09:09:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="643">&lt;includeonly&gt;
{{DISPLAYTITLE:&lt;font size=4&gt;&lt;a href=&quot;{{{1}}}&quot;&gt;{{{1}}}&lt;/a&gt; / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
}}
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1622</id>
      <timestamp>2012-07-23T09:11:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="738">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;div style=&quot;width:100%;border-bottom: #eee 1px solid&quot;&gt;
&lt;font size=4&gt;&lt;a href=&quot;{{{1}}}&quot;&gt;{{{1}}}&lt;/a&gt; / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
&lt;/div&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1623</id>
      <timestamp>2012-07-23T09:12:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="720">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;div style=&quot;width:100%;border-bottom: #eee 1px solid&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
&lt;/div&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1624</id>
      <timestamp>2012-07-23T09:13:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="720">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;div style=&quot;width:100%;border-bottom: #999 1px solid&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
{{#if: {{{p}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
&lt;/div&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1625</id>
      <timestamp>2012-07-23T09:14:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="755">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}
&lt;div style=&quot;width:100%;border-bottom: #999 1px solid&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | Next: &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | &amp;lt;&amp;lt;&amp;nbsp;{{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;
&lt;/includeonly&gt;
&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1626</id>
      <timestamp>2012-07-23T09:16:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | Next: &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | {{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | Previous: &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1627</id>
      <timestamp>2012-07-23T09:17:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="833">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | Next: &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{p}}} | {{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | Previous: &lt;font size=3 style=&quot;font-weight: bold&quot;&gt;[[{{{1}}}/{{{n}}} | {{{n}}}&amp;nbsp;&amp;gt;&amp;gt;]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1628</id>
      <timestamp>2012-07-23T09:17:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | Next: &lt;font size=3&gt;[[{{{1}}}/{{{p}}} | {{{p}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | Previous: &lt;font size=3&gt;[[{{{1}}}/{{{n}}} | {{{n}}}]]&lt;/font&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1629</id>
      <timestamp>2012-07-23T09:18:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="727">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | Next: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | Previous: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1630</id>
      <timestamp>2012-07-23T09:18:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="727">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=4&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{n}}} | previous: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{p}}} | next: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1631</id>
      <timestamp>2012-07-23T09:19:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="727">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=5&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{n}}} | previous: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{p}}} | next: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1632</id>
      <timestamp>2012-07-23T09:19:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="743">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=5&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1633</id>
      <timestamp>2012-07-23T09:21:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="766">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 5px&quot;&gt;
&lt;font size=5&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;div float=right&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1634</id>
      <timestamp>2012-07-23T09:22:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="767">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 10px&quot;&gt;
&lt;font size=5&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;div float=right&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1635</id>
      <timestamp>2012-07-23T09:22:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="772">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;visibility:hidden&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 10px&quot;&gt;
&lt;font size=5&gt;[[{{{1}}}]] / {{{2}}}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;div float=right&gt;{{#if: {{{p|}}} {{{n|}}}
|
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}
|
}}&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1636</id>
      <timestamp>2012-07-23T09:24:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="586">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;
&lt;font size=5&gt;{{{2}}}&lt;/font&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]
}}{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]
}}}}&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1637</id>
      <timestamp>2012-07-23T09:24:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="590">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
&lt;font size=5&gt;{{{2}}}&lt;/font&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]
}}{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]
}}}}&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1638</id>
      <timestamp>2012-07-23T09:25:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="589">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;display:none&quot;&gt;&lt;/span&gt;}}&lt;div style=&quot;width:100%;border-bottom: #999 1px solid;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
&lt;font size=5&gt;{{{2}}}&lt;/font&gt;{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]
}}{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]
}}}}&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1639</id>
      <timestamp>2012-07-23T09:26:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="499">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1640</id>
      <timestamp>2012-07-23T09:26:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="538">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;margin-bottom-5px&quot;&gt;{{{2}}}&lt;/span&gt;}}&lt;div style=&quot;width:100%;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1641</id>
      <timestamp>2012-07-23T09:26:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="538">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;margin-bottom:5px&quot;&gt;{{{2}}}&lt;/span&gt;}}&lt;div style=&quot;width:100%;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1642</id>
      <timestamp>2012-07-23T09:27:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="539">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;margin-bottom:-5px&quot;&gt;{{{2}}}&lt;/span&gt;}}&lt;div style=&quot;width:100%;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1643</id>
      <timestamp>2012-07-23T09:27:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="540">&lt;includeonly&gt;{{DISPLAYTITLE:&lt;span style=&quot;margin-bottom:-50px&quot;&gt;{{{2}}}&lt;/span&gt;}}&lt;div style=&quot;width:100%;margin-bottom: 10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1644</id>
      <timestamp>2012-07-23T09:27:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="516">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 10px;margin-top: -8px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
}}&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1645</id>
      <timestamp>2012-07-23T09:28:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="515">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 10px;margin-top: -10px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1646</id>
      <timestamp>2012-07-23T09:29:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="515">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 10px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1647</id>
      <timestamp>2012-07-23T09:30:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="515">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 14px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1648</id>
      <timestamp>2012-07-23T09:30:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="522">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 14px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}
&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1649</id>
      <timestamp>2012-07-23T09:32:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="521">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom: 14px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;
{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}
{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1650</id>
      <timestamp>2012-07-23T09:33:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="503">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1651</id>
      <timestamp>2012-07-23T09:34:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="521">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation | Navigation book index | p=Previous page | n=Next page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1654</id>
      <timestamp>2012-07-23T09:36:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="507">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will place a navigation block and disable page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1655</id>
      <timestamp>2012-07-23T09:36:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="512">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block which will replace page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1656</id>
      <timestamp>2012-07-23T09:36:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="503">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | previous chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | next chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1658</id>
      <timestamp>2012-07-23T09:37:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="503">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | next chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | previous chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1661</id>
      <timestamp>2012-07-23T09:39:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Navigation]] to [[Template:Navigation title]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="503">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | next chapter: [[{{{1}}}/{{{n}}} | {{{n}}}]]}}&lt;br&gt;{{#if: {{{p}}} | previous chapter: [[{{{1}}}/{{{p}}} | {{{p}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1674</id>
      <timestamp>2012-07-23T09:49:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="433">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{n}}} | next chapter: [[{{{1}}}/{{{3}}} | {{{3}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1679</id>
      <timestamp>2012-07-23T09:50:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="433">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3}}} | next chapter: [[{{{1}}}/{{{3}}} | {{{3}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1680</id>
      <timestamp>2012-07-23T09:50:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="439">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=3&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1681</id>
      <timestamp>2012-07-23T09:51:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="439">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1682</id>
      <timestamp>2012-07-23T09:52:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="477">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}&lt;img align=left src=&quot;PageAncient.png&quot;&gt;}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1683</id>
      <timestamp>2012-07-23T09:53:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="463">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}[[File:PageAncient.png]]}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1684</id>
      <timestamp>2012-07-23T09:53:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="439">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1685</id>
      <timestamp>2012-07-23T09:53:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="463">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:PageAncient.png]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1686</id>
      <timestamp>2012-07-23T09:54:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="468">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:PageAncient.png|32px]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1687</id>
      <timestamp>2012-07-23T09:54:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:PageAncient.png|32px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1688</id>
      <timestamp>2012-07-23T09:54:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:PageAncient.png|40px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1689</id>
      <timestamp>2012-07-23T09:55:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:PageAncient.png|38px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1692</id>
      <timestamp>2012-07-23T10:03:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="471">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|38px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|p=Previous|n=Next}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1693</id>
      <timestamp>2012-07-23T10:04:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="463">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|38px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1694</id>
      <timestamp>2012-07-23T10:04:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="469">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|38px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation title|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1695</id>
      <timestamp>2012-07-23T10:04:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="469">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|42px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation title|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1696</id>
      <timestamp>2012-07-23T10:05:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="469">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

== Usage ==
 &lt;nowiki&gt;{{navigation title|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2062</id>
      <timestamp>2012-07-27T18:45:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="457">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | next chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

 &lt;nowiki&gt;{{navigation title|Index_Page|Current_Page|Next_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2064</id>
      <timestamp>2012-07-27T18:50:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="461">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | previous chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]]}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

 &lt;nowiki&gt;{{navigation title|Index_Page|Current_Page|Prev_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2066</id>
      <timestamp>2012-07-27T18:54:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="474">&lt;includeonly&gt;{{DISPLAYTITLE:{{{2|}}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{{1|}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | previous chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]] | &amp;nbsp;&lt;br&gt;}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a navigation block replacing page title.

 &lt;nowiki&gt;{{navigation title|Index_Page|Current_Page|Prev_Page}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2074</id>
      <timestamp>2012-07-27T19:14:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="650">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | previous chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]] | &amp;nbsp;&lt;br&gt;}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''.
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2075</id>
      <timestamp>2012-07-27T19:15:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="651">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | previous chapter: [[{{{1|}}}/{{{3|}}} | {{{3|}}}]] | &amp;nbsp;&lt;br&gt;}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2078</id>
      <timestamp>2012-07-27T19:19:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="692">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{3|}}} | previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]] | &amp;nbsp;&lt;br&gt;}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2079</id>
      <timestamp>2012-07-27T19:19:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="692">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{1|}}} | previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]] | &amp;nbsp;&lt;br&gt;}}&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2084</id>
      <timestamp>2012-07-27T19:23:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="698">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}[[File:Reference.png|44px|left]]&lt;div style=&quot;width:100%;margin-bottom:5px;margin-top: -13px&quot;&gt;
&lt;font size=2&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;&lt;br&gt;{{#if: {{{1|}}} | previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]] | &amp;nbsp;&lt;br&gt;}}
----
&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2085</id>
      <timestamp>2012-07-27T19:24:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="608">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;{{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]] | &amp;nbsp;&lt;br&gt;}}
----
&lt;/div&gt;__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2086</id>
      <timestamp>2012-07-27T19:25:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="602">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;{{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]] | &amp;nbsp;&lt;br&gt;}}
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2087</id>
      <timestamp>2012-07-27T19:26:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="628">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -13px&quot;&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]]&lt;/font&gt;{{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2088</id>
      <timestamp>2012-07-27T19:27:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="690">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] &lt;nowiki&gt;|&lt;/nowiki&gt; [[#bottom | Bottom of the page]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2089</id>
      <timestamp>2012-07-27T19:28:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="638">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2090</id>
      <timestamp>2012-07-27T19:31:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="730">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;span style=&quot;margin-top: -4px; margin-bottom: -5px&quot;&gt;[[File:Reference.png|20px|left]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2091</id>
      <timestamp>2012-07-27T19:31:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="730">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;span style=&quot;margin-top: -4px; margin-bottom: -5px&quot;&gt;[[File:Reference.png|28px|left]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2092</id>
      <timestamp>2012-07-27T19:31:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="730">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;span style=&quot;margin-top: -6px; margin-bottom: -6px&quot;&gt;[[File:Reference.png|25px|left]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2093</id>
      <timestamp>2012-07-27T19:32:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="732">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;span style=&quot;margin-top: -10px; margin-bottom: -10px&quot;&gt;[[File:Reference.png|25px|left]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2094</id>
      <timestamp>2012-07-27T19:32:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="732">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;span style=&quot;margin-top: -40px; margin-bottom: -10px&quot;&gt;[[File:Reference.png|25px|left]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2095</id>
      <timestamp>2012-07-27T19:32:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="733">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;span style=&quot;padding-top: -40px; margin-bottom: -10px&quot;&gt;[[File:Reference.png|25px|left]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2096</id>
      <timestamp>2012-07-27T19:35:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="743">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;div style=&quot;padding-top: -40px; margin-bottom: -10px&quot;&gt;[[File:Reference.png|25px|left|alt=|link=]]&lt;/span&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2097</id>
      <timestamp>2012-07-27T19:35:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="742">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -9px;padding-left:5px&quot;&gt;
&lt;div style=&quot;padding-top: -40px; margin-bottom: -10px&quot;&gt;[[File:Reference.png|25px|left|alt=|link=]]&lt;/div&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2098</id>
      <timestamp>2012-07-27T19:35:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="754">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -13px;padding-left:5px&quot;&gt;
&lt;span style=&quot;margin-top: -40px !important; margin-bottom: -10px&quot;&gt;[[File:Reference.png|25px|left|alt=|link=]]&lt;/div&gt;
[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2099</id>
      <timestamp>2012-07-27T19:36:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="721">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -11px;padding-left:5px&quot;&gt;
[[File:Reference.png|25px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 3px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2100</id>
      <timestamp>2012-07-27T19:36:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="721">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -12px;padding-left:5px&quot;&gt;
[[File:Reference.png|24px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 4px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2101</id>
      <timestamp>2012-07-27T19:37:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="721">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top: -12px;padding-left:5px&quot;&gt;
[[File:Reference.png|22px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 5px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2102</id>
      <timestamp>2012-07-27T19:37:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="739">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom:-2px;padding-left:5px&quot;&gt;
[[File:Reference.png|24px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 6px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2103</id>
      <timestamp>2012-07-27T19:38:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="739">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom:-2px;padding-left:5px&quot;&gt;
[[File:Reference.png|22px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 8px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2104</id>
      <timestamp>2012-07-27T19:38:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="739">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom:-2px;padding-left:5px&quot;&gt;
[[File:Reference.png|21px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 8px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2105</id>
      <timestamp>2012-07-27T19:38:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="739">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom:-2px;padding-left:5px&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 8px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2106</id>
      <timestamp>2012-07-27T19:39:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="720">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;padding-left:5px&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 4px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2107</id>
      <timestamp>2012-07-27T19:39:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="720">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;padding-left:5px&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;padding-top: 8px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2108</id>
      <timestamp>2012-07-27T19:39:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="719">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;padding-left:5px&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
----
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2109</id>
      <timestamp>2012-07-27T19:40:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="744">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2110</id>
      <timestamp>2012-07-27T19:40:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="764">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: -5px;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2111</id>
      <timestamp>2012-07-27T19:41:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="763">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2112</id>
      <timestamp>2012-07-27T19:41:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="785">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2113</id>
      <timestamp>2012-07-27T19:41:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="800">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px;font-size:14px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2114</id>
      <timestamp>2012-07-27T19:42:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="800">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px;font-size:16px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2115</id>
      <timestamp>2012-07-27T19:42:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="812">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]
&lt;span style=&quot;margin-top: 2px;font-size:16px;padding:0px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;
&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2116</id>
      <timestamp>2012-07-27T19:43:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="810">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px;font-size:16px;padding:0px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2117</id>
      <timestamp>2012-07-27T19:43:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="783">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2118</id>
      <timestamp>2012-07-27T19:44:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="802">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;/div&gt;
__TOC__&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2899</id>
      <timestamp>2012-11-23T01:16:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="858">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2900</id>
      <timestamp>2012-11-23T01:17:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="858">&lt;includeonly&gt;{{DISPLAYTITLE:{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|/|0}}+1}}|10000}}}}
&lt;div style=&quot;margin-top:-12px;margin-bottom: 4px;vertical-align:middle;padding-left:5px;padding-bottom:3px;border-bottom: 1px #999 solid&quot;&gt;
[[File:Reference.png|20px|left|alt=|link=]]&lt;span style=&quot;margin-top: 2px&quot;&gt;[[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}]] {{#if: {{{1|}}} | &lt;nowiki&gt;|&lt;/nowiki&gt; previous chapter: [[{{#sub:{{PAGENAME}}|0|{{#pos:{{PAGENAME}}|/|0}}}}/{{{1|}}} | {{{1|}}}]]}}&lt;/span&gt;&lt;div style=&quot;margin:8px;margin-top:2px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
This template will set a book navigation title replacing page title.

 &lt;nowiki&gt;{{navigation title|Prev_Page}}&lt;/nowiki&gt;

{{important|All pages int the book  should be numbered this way: '''Page Index'''/'''Chapter'''}}
[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Need screenshot</title>
    <ns>10</ns>
    <id>174</id>
      <sha1>g6p14242exrxaxkwr2jyw3l5ddcat34</sha1>
    <revision>
      <id>2037</id>
      <timestamp>2012-07-27T15:06:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{messagebox |text=This page requires a screenshot or video of the subject |small=Want to make one? |picture=[[File:PageScreenshot.png|36px|alt=|link]] |border=gr...&quot;</comment>
      <text xml:space="preserve" bytes="711">&lt;includeonly&gt;{{messagebox
|text=This page requires a screenshot or video of the subject
|small=Want to make one?
|picture=[[File:PageScreenshot.png|36px|alt=|link]]
|border=gray
|category=Need screenshot
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that should have a screenshot or video of the subject. This will allow pages to show up in &quot;Need screenshot&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{needscreenshot}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page requires a screenshot or video of the subject
|small=Want to make one? Feel free!
|picture=[[File:PageScreenshot.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2041</id>
      <timestamp>2012-07-27T15:08:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:Needscreenshot]] to [[Template:Need screenshot]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="711">&lt;includeonly&gt;{{messagebox
|text=This page requires a screenshot or video of the subject
|small=Want to make one?
|picture=[[File:PageScreenshot.png|36px|alt=|link]]
|border=gray
|category=Need screenshot
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that should have a screenshot or video of the subject. This will allow pages to show up in &quot;Need screenshot&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{needscreenshot}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page requires a screenshot or video of the subject
|small=Want to make one? Feel free!
|picture=[[File:PageScreenshot.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:NemiciBO</title>
    <ns>10</ns>
    <id>635</id>
      <sha1>du4vwe7mzydwx24f6zw7dkxsg7p9g9i</sha1>
    <revision>
      <id>3536</id>
      <timestamp>2013-01-24T18:07:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt; &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt; &lt;tr&gt;&lt;td style=&quot;font-weight:b...&quot;</comment>
      <text xml:space="preserve" bytes="1217">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;[[Category:InItalian/Personaggi di Blood Omen]]&lt;/includeonly&gt;&lt;noinclude&gt;
Template per i nemici in Blood Omen.
 &lt;nowiki&gt;{{NemiciBO|background|picture|name}}&lt;/nowiki&gt;

Example:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;name&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Immagini animate inseribili=====
Vedi l'elenco su [[:Category:Blood Omen enemy pictures]].

=====Sfondi utilizzabili=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3537</id>
      <timestamp>2013-01-24T18:09:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1217">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;[[Category:InItalian/Personaggi di Blood Omen]]&lt;/includeonly&gt;&lt;noinclude&gt;
Template per i nemici in Blood Omen.
 &lt;nowiki&gt;{{NemiciBO|di sfondo|immagini|nome}}&lt;/nowiki&gt;

Esempio:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;nome&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Immagini animate inseribili=====
Vedi l'elenco su [[:Category:Blood Omen enemy pictures]].

=====Sfondi utilizzabili=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>3539</id>
      <timestamp>2013-01-24T18:13:08Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="1214">&lt;includeonly&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px;float:right&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;{{{name|{{{3}}}}}}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_{{{background|{{{1}}}}}}&quot;&gt;[[File:{{{picture|{{{2}}}}}}|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;[[Category:InItalian/Personaggi di Blood Omen]]&lt;/includeonly&gt;&lt;noinclude&gt;
Template per i nemici in Blood Omen.
 &lt;nowiki&gt;{{NemiciBO|sfondo|immagini|nome}}&lt;/nowiki&gt;

Esempio:

&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; style=&quot;min-height:200px;table-layout:fixed;border-collapse:collapse;padding:5px&quot;&gt;
&lt;tr&gt;&lt;td style=&quot;font-weight:bold;text-align:center;vertical-align:middle&quot;&gt;&amp;nbsp;&amp;nbsp;nome&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;bo_bg_out&quot;&gt;[[File:bo_enemy_cave_abomination.gif|link=]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=====Immagini animate inseribili=====
Vedi l'elenco su [[:Category:Blood Omen enemy pictures]].

=====Sfondi utilizzabili=====
* ave
* bastion
* cave
* cave2
* choppin
* collector
* crypt1
* crypt2
* crypt3
* dung
* dung2
* dung3
* eden
* eden2
* grv
* house1
* house2
* inn
* out
* out2
* smith
* tower
* wall
* willen

[[Category:InItalian/Templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Outdated</title>
    <ns>10</ns>
    <id>168</id>
      <sha1>j2dvnid6zyqxjb1lyznv0px7vsoqy4s</sha1>
    <revision>
      <id>2009</id>
      <timestamp>2012-07-27T14:14:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{messagebox |text=Information on this page is not up to date |small=It is required to bring things in sync with the latest version of Blood Omnicide |picture=[[F...&quot;</comment>
      <text xml:space="preserve" bytes="667">&lt;includeonly&gt;{{messagebox
|text=Information on this page is not up to date
|small=It is required to bring things in sync with the latest version of Blood Omnicide
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Outdated pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project.

Usage:
 &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=Information on this page is not up to date
|small=It is required to bring things in sync with the latest version of Blood Omnicide
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Page bricks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2010</id>
      <timestamp>2012-07-27T14:15:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="782">&lt;includeonly&gt;{{messagebox
|text=Information on this page is not up to date
|small=It is required to bring things in sync with the latest version of Blood Omnicide
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Outdated pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Outdated pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=Information on this page is not up to date
|small=It is required to bring things in sync with the latest version of Blood Omnicide
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Page bricks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2011</id>
      <timestamp>2012-07-27T14:24:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="781">&lt;includeonly&gt;{{messagebox
|text=Information on this page is not up to date
|small=It is required to bring things in sync with the latest version of Blood Omnicide
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Outdated pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Outdated pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=Information on this page is not up to date
|small=It is required to bring things in sync with the latest version of Blood Omnicide
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2032</id>
      <timestamp>2012-07-27T14:49:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="785">&lt;includeonly&gt;{{messagebox
|text=Information on this page is not up to date
|small=This page needs to be updated to include current information regarding the subject
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Outdated pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Outdated pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=Information on this page is not up to date
|small=This page needs to be updated to include current information regarding the subject
|picture=[[File:PageOutdated.png|36px|alt=|link]]
|border=green
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:TOCRIGHT</title>
    <ns>10</ns>
    <id>309</id>
      <sha1>f75atk1e1188ktp3fq0pwqlpuuw2gac</sha1>
    <revision>
      <id>2888</id>
      <timestamp>2012-11-23T00:30:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;This template will insert a floating Table-Of-Contents on the right side of the page.  Usage:  &lt;now...&quot;</comment>
      <text xml:space="preserve" bytes="248">&lt;includeonly&gt;&lt;div style=&quot;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;This template will insert a floating Table-Of-Contents on the right side of the page.

Usage:
 &lt;nowiki&gt;{{TOCFLOAT}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2889</id>
      <timestamp>2012-11-23T00:36:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="259">&lt;includeonly&gt;&lt;div style=&quot;margin:8px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;This template will insert a floating Table-Of-Contents on the right side of the page.

Usage:
 &lt;nowiki&gt;{{TOCFLOAT}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2894</id>
      <timestamp>2012-11-23T01:12:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Template:TOCFLOAT]] to [[Template:TOCRIGHT]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="259">&lt;includeonly&gt;&lt;div style=&quot;margin:8px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;This template will insert a floating Table-Of-Contents on the right side of the page.

Usage:
 &lt;nowiki&gt;{{TOCFLOAT}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2895</id>
      <timestamp>2012-11-23T01:13:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="259">&lt;includeonly&gt;&lt;div style=&quot;margin:8px;float:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;This template will insert a floating Table-Of-Contents on the right side of the page.

Usage:
 &lt;nowiki&gt;{{TOCRIGHT}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2905</id>
      <timestamp>2012-11-23T01:26:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="271">&lt;includeonly&gt;&lt;div style=&quot;margin:8px;float:right;clear:right&quot;&gt;__TOC__&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;This template will insert a floating Table-Of-Contents on the right side of the page.

Usage:
 &lt;nowiki&gt;{{TOCRIGHT}}&lt;/nowiki&gt;

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Tip</title>
    <ns>10</ns>
    <id>147</id>
      <sha1>1temy2crp0bsxb8r962q9rkzfpamg8f</sha1>
    <revision>
      <id>1823</id>
      <timestamp>2012-07-26T14:20:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link...&quot;</comment>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:bug.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1824</id>
      <timestamp>2012-07-26T14:21:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:tip.png|link=|alt=]] Bug:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1825</id>
      <timestamp>2012-07-26T14:21:12Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="473">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;padding-right:0.3em;white-space:nowrap&quot;&gt;[[File:tip.png|link=|alt=]] Tip:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1846</id>
      <timestamp>2012-07-26T16:33:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="425">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1847</id>
      <timestamp>2012-07-26T16:33:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="426">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip: &lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1848</id>
      <timestamp>2012-07-26T16:33:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="431">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip:&amp;nbsp;&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1849</id>
      <timestamp>2012-07-26T16:34:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="431">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 1em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1850</id>
      <timestamp>2012-07-26T16:34:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="431">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;

{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1851</id>
      <timestamp>2012-07-26T16:35:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="430">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{tip|some useful note}}

[[Category:Noticing templates]]
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>1941</id>
      <timestamp>2012-07-27T10:39:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="432">&lt;includeonly&gt;&lt;div style=&quot;margin:0.4em 0em 0.5em;&quot;&gt;&lt;font style=&quot;font-weight:bold;display:table-cell;text-align:right;white-space:nowrap&quot;&gt;Tip:&lt;/font&gt;&lt;span style=&quot;display:table-cell&quot;&gt;&amp;nbsp;{{{1}}}&lt;/span&gt;&lt;/div&gt;&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template where you want to notify about some useful thing.
 &lt;nowiki&gt;{{&lt;/nowiki&gt;tip|some useful note&lt;nowiki&gt;}}&lt;/nowiki&gt;
{{tip|some useful note}}

[[Category:Formatting templates]]
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Unfinished</title>
    <ns>10</ns>
    <id>166</id>
      <sha1>ozro1odog2uw1obhki02nnk96f4qn4e</sha1>
    <revision>
      <id>1996</id>
      <timestamp>2012-07-27T13:59:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{messagebox |text=This page is not finished |small=It requires more stuff, explanations and refs. Feel free to contribute! |picture=[[File:PageUnfinished.png|36p...&quot;</comment>
      <text xml:space="preserve" bytes="720">&lt;includeonly&gt;{{messagebox
|text=This page is not finished
|small=It requires more stuff, explanations and refs. Feel free to contribute!
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Unfinished pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that is not finished. This will allow pages to show up in &quot;Unfinished pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is not finished
|small=It requires more stuff, explanations and refs. Feel free to contribute!
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Page bricks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2012</id>
      <timestamp>2012-07-27T14:24:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="719">&lt;includeonly&gt;{{messagebox
|text=This page is not finished
|small=It requires more stuff, explanations and refs. Feel free to contribute!
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Unfinished pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that is not finished. This will allow pages to show up in &quot;Unfinished pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is not finished
|small=It requires more stuff, explanations and refs. Feel free to contribute!
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2154</id>
      <timestamp>2012-07-29T14:06:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="745">&lt;includeonly&gt;{{messagebox
|text=This page is not finished
|small=You can help by [{{fullurl:{{FULLPAGENAME}}|action=edit}} editing and extending] it.
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Unfinished pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that is not finished. This will allow pages to show up in &quot;Unfinished pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is not finished
|small=You can help by [{{fullurl:{{FULLPAGENAME}}|action=edit}} editing and extending] it.
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2155</id>
      <timestamp>2012-07-29T14:07:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="720">&lt;includeonly&gt;{{messagebox
|text=This page is not finished
|small=You can help by [[&amp;action=edit]] editing and extending] it.
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Unfinished pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that is not finished. This will allow pages to show up in &quot;Unfinished pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is not finished
|small=You can help by [{{fullurl:{{FULLPAGENAME}}|action=edit}} editing and extending] it.
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2156</id>
      <timestamp>2012-07-29T14:07:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="671">&lt;includeonly&gt;{{messagebox
|text=This page is not finished
|small=You can help by '''editing and extending''' it.
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Unfinished pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that is not finished. This will allow pages to show up in &quot;Unfinished pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{unfinished}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is not finished
|small=You can help by '''editing and extending''' it.
|picture=[[File:PageUnfinished.png|36px|alt=|link]]
|border=darkred
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:WIP</title>
    <ns>10</ns>
    <id>172</id>
      <sha1>6bxckmv8o821agsslm4jfuxejigik4w</sha1>
    <revision>
      <id>2024</id>
      <timestamp>2012-07-27T14:41:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;&lt;includeonly&gt;{{messagebox |text=This page is being heavily modified by another user |small=The person who added this notice will be listed in edits history should you wish to ...&quot;</comment>
      <text xml:space="preserve" bytes="802">&lt;includeonly&gt;{{messagebox
|text=This page is being heavily modified by another user
|small=The person who added this notice will be listed in edits history should you wish to contact him or her.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Work-In-Progress pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Outdated pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is being heavily modified by another user
|small=The person who added this notice will be listed in edits history
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2025</id>
      <timestamp>2012-07-27T14:43:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="753">&lt;includeonly&gt;{{messagebox
|text=This page is actively undergoing a major edit
|small=The person who added this notice will be listed in edits history.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Work-In-Progress pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Outdated pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{outdated}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is actively undergoing a major edit
|small=The person who added this notice will be listed in edits history.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2026</id>
      <timestamp>2012-07-27T14:44:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="748">&lt;includeonly&gt;{{messagebox
|text=This page is actively undergoing a major edit
|small=The person who added this notice will be listed in edits history.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Work-In-Progress pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Outdated pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{wip}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is actively undergoing a major edit
|small=The person who added this notice will be listed in edits history.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2027</id>
      <timestamp>2012-07-27T14:44:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="756">&lt;includeonly&gt;{{messagebox
|text=This page is actively undergoing a major edit
|small=The person who added this notice will be listed in edits history.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Work-In-Progress pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Work-In-Progress pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{wip}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is actively undergoing a major edit
|small=The person who added this notice will be listed in edits history.
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
    <revision>
      <id>2028</id>
      <timestamp>2012-07-27T14:46:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="820">&lt;includeonly&gt;{{messagebox
|text=This page is actively [[:Category:Work-In-Progress | undergoing a major edit]]
|small=The person who added this notice will be listed in edits history
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Work-In-Progress pages
}}&lt;/includeonly&gt;&lt;noinclude&gt;
Use this template on a very top of pages that doesnt fit current state of the project. This will allow pages to show up in &quot;Work-In-Progress pages&quot; section on [[BloodWiki:Community portal | Community Portal]].

Usage:
 &lt;nowiki&gt;{{wip}}&lt;/nowiki&gt;

Preview:
{{messagebox
|text=This page is actively [[:Category:Work-In-Progress | undergoing a major edit]]
|small=The person who added this notice will be listed in edits history
|picture=[[File:PageWIP.png|36px|alt=|link]]
|border=gray
|category=Page marks
}}
&lt;/noinclude&gt;</text>
    </revision>
  </page>
  <page>
    <title>Texture</title>
    <ns>0</ns>
    <id>90</id>
      <sha1>8gocmfzsqb3fl06uqn7mf2obbww2q9v</sha1>
    <revision>
      <id>874</id>
      <timestamp>2012-07-16T19:03:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;An image or graphic which can be applied to a surface.   = See also = * [[Shader]] * [[Material system]]&quot;</comment>
      <text xml:space="preserve" bytes="104">An image or graphic which can be applied to a surface. 

= See also =
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1178</id>
      <timestamp>2012-07-18T00:18:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1027">An image or graphic which can be applied to a surface. 

== Textures are skinframes ==

In darkplaces, each map texture is represented by skinframe - a set of images containing base texture and additional textures prefixed with special works and used to store additional information:

* _norm - normalmap texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - specular texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

= See also =
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1179</id>
      <timestamp>2012-07-18T00:19:44Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1066">An image or graphic which can be applied to a surface. 

== Level textures are skinframes ==

In darkplaces, each level and model textures is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

= See also =
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1180</id>
      <timestamp>2012-07-18T00:20:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1089">An image or graphic which can be applied to a surface. 

== Level textures are skinframes ==

In [[Darkplaces engine | Darkplaces]] each level and model textures is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

= See also =
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1181</id>
      <timestamp>2012-07-18T00:21:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1088">An image or graphic which can be applied to a surface. 

== Level textures are skinframes ==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

= See also =
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1236</id>
      <timestamp>2012-07-18T10:44:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1137">An image or graphic which can be applied to a surface. 

== Level textures are skinframes ==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

= See also =
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1789</id>
      <timestamp>2012-07-26T11:08:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1137">An image or graphic which can be applied to a surface. 

== Level textures are skinframes ==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

==See also==
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1790</id>
      <timestamp>2012-07-26T11:08:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1135">An image or graphic which can be applied to a surface. 

==Level textures are skinframes==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

==See also==
* [[Shader]]
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1902</id>
      <timestamp>2012-07-27T09:20:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1146">An image or graphic which can be applied to a surface. 

==Level textures are skinframes==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

Skinframe is not a [[skin]].

==See also==
* [[Shader]]
* [[Darkplaces material system]]</text>
    </revision>
    <revision>
      <id>1903</id>
      <timestamp>2012-07-27T09:20:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1160">An image or graphic which can be applied to a surface. 

==Level textures are skinframes==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

{{important|Skinframe is not a [[skin]].}}

==See also==
* [[Shader]]
* [[Darkplaces material system]]</text>
    </revision>
    <revision>
      <id>2301</id>
      <timestamp>2012-07-30T21:53:29Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1196">An image or graphic which can be applied to a surface. 

==Level textures are skinframes==

In [[Darkplaces engine | Darkplaces]] each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga - base texture
 textures/inn/table_norm.tga - normalmap
 textures/inn/table_gloss.tga - gloss

{{important|Skinframe is not a [[skin]].}}

==See also==
* [[Shader]]
* [[Darkplaces material system]]

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2352</id>
      <timestamp>2012-08-01T09:43:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1196">An image or graphic which can be applied to a surface. 

==Level textures are skinframes==

In Darkplaces engine engine each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga // base texture
 textures/inn/table_norm.tga // normalmap
 textures/inn/table_gloss.tga // specular map

{{important|Skinframe is not a [[skin]].}}

==See also==
* [[Shader]]
* [[Darkplaces material system]]

[[Category:Glossary]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2353</id>
      <timestamp>2012-08-01T09:44:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1200">An image or graphic which can be applied to a surface. 

==Level textures are skinframes==

In Darkplaces engine engine each level and model texture is represented by skinframe.

Skinframe is a set of images containing base texture and additional textures prefixed with special word and used to store additional information:

* _norm - [[normalmap]] texture for per pixel lighting (alpha stores heightmap for [[parallax mapping]])
* _gloss - [[specular]] texture for per pixel lighting, can be in color (alpha stores gloss exponent)
* _glow - fullbrights or other glowing overlay stuff (this is done using additive blend, not alpha)
* _pants - pants overlay for colormapping on models, should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend
* _shirt - same idea as pants, but for shirt color
* _reflect - mask for cubemap reflection texture

Sample:
 textures/inn/table.tga // base texture
 textures/inn/table_norm.tga // normalmap
 textures/inn/table_gloss.tga // specular texture

{{important|Skinframe is not a [[skin]].}}

==See also==
* [[Shader]]
* [[Darkplaces material system]]

[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Texture coordinates</title>
    <ns>0</ns>
    <id>85</id>
      <sha1>m83sfnur1rdl3ksd84h2kr647uo7whc</sha1>
    <revision>
      <id>852</id>
      <timestamp>2012-07-16T17:25:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry.  Texture coordinates are independent from texture resolution. In ...&quot;</comment>
      <text xml:space="preserve" bytes="284">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry.

Texture coordinates are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1).

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>853</id>
      <timestamp>2012-07-16T17:26:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="427">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry.

Texture coordinates are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1).

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1282</id>
      <timestamp>2012-07-20T07:56:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="465">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry.

Texture coordinates are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1).

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

[[Category:Glossary]]

== See also ==
* [[Material system]]</text>
    </revision>
    <revision>
      <id>1283</id>
      <timestamp>2012-07-20T07:56:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="465">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry.

Texture coordinates are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1).

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1286</id>
      <timestamp>2012-07-20T08:04:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="875">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

== UVW map stores texture coordinates ==

UVW map is array of vertices. Each model triangle have a three corresponding vertices on UVW map, storing texture coordinate.

== Normalization ==

Texture coordinates are normalized to the image size, in other words they are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

== Usage ==

Texture coordinates are used on mesh models and [[Patch mesh | patch meshed]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1287</id>
      <timestamp>2012-07-20T08:05:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="846">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

== UV map ==

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

== Normalization ==

Texture coordinates are normalized to the image size, in other words they are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

== Usage ==

Texture coordinates are used on mesh models and [[Patch mesh | patch meshed]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1288</id>
      <timestamp>2012-07-20T08:06:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="846">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

== UV map ==

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

== Normalization ==

Texture coordinates are normalized to the image size, in other words they are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

== Usage ==

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1292</id>
      <timestamp>2012-07-20T09:07:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="834">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

== UV map ==

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

== Normalization ==

Texture coordinates are normalized to the image size, so they are independent from texture resolution. In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

== Usage ==

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1293</id>
      <timestamp>2012-07-20T09:11:23Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="835">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

== UV map ==

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

== Normalization ==

Texture coordinates are normalized to the image size, so they are independent from texture resolution.

In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

== Usage ==

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1294</id>
      <timestamp>2012-07-20T09:13:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="841">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

=== UV map ===

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

=== Normalization ===

Texture coordinates are normalized to the image size, so they are independent from texture resolution.

In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

=== Usage ===

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]</text>
    </revision>
    <revision>
      <id>1295</id>
      <timestamp>2012-07-20T09:13:21Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="852">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

=== UV map ===

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

=== Normalization ===

Texture coordinates are normalized to the image size, so they are independent from texture resolution.

In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

=== Usage ===

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1360</id>
      <timestamp>2012-07-22T15:17:28Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="871">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

=== UV map ===

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

=== Normalization ===

Texture coordinates are normalized to the image size, so they are independent from texture resolution.

In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

=== Usage ===

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates as an direct input, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Material system]]

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>1901</id>
      <timestamp>2012-07-27T09:19:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="882">Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

=== UV map ===

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

=== Normalization ===

Texture coordinates are normalized to the image size, so they are independent from texture resolution.

In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

=== Usage ===

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates as an direct input, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Darkplaces material system]]

[[Category:Glossary]]

__NOTOC__</text>
    </revision>
    <revision>
      <id>2306</id>
      <timestamp>2012-07-30T21:55:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="914">{{need screenshot}}
Texture coordinates is a part of 3D model data, storing information which is used to map texture on geometry. 

=== UV map ===

UV map is array of vertices. Each model triangle have a three corresponding vertices on UV map, storing texture coordinates.

=== Normalization ===

Texture coordinates are normalized to the image size, so they are independent from texture resolution.

In Blood Omnicide, up left corner of texture is always (0, 0) and right bottom is (1, 1). A values greater than 1 or lesser than 0 causes texture to be repeated.

=== Usage ===

Texture coordinates are used on mesh models and [[Patch mesh | patch meshes]].

[[brush | Brushes]] dont use texture coordinates as an direct input, they are using special technique to generate texture coordinates called texture projection.

== See also ==
* [[Darkplaces material system]]

[[Category:Glossary]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>Translating</title>
    <ns>0</ns>
    <id>6</id>
    <redirect title="Translation" />
      <sha1>0grspky9arc80y3z8df8fjl1itnlbn2</sha1>
    <revision>
      <id>38</id>
      <timestamp>2012-07-02T14:40:36Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>VorteX moved page [[Translating]] to [[Translation]]: Misspelled</comment>
      <text xml:space="preserve" bytes="25">#REDIRECT [[Translation]]</text>
    </revision>
  </page>
  <page>
    <title>Translation</title>
    <ns>0</ns>
    <id>3</id>
      <sha1>n6v27o7wvsntqfzdnkdgnfblgv39akr</sha1>
    <revision>
      <id>16</id>
      <timestamp>2012-07-02T13:04:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Blood Omnicide support localization packs in the form of separate [[PK3 files]]. This article will explain how to edit them, creating your own localization pack.&quot;</comment>
      <text xml:space="preserve" bytes="161">Blood Omnicide support localization packs in the form of separate [[PK3 files]]. This article will explain how to edit them, creating your own localization pack.</text>
    </revision>
    <revision>
      <id>17</id>
      <timestamp>2012-07-02T13:09:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="993">Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. This article will explain how to edit them, creating your own localization pack.

Blood Omnicide's translation packs follows this rules:
- Translate texts, texturesm sounds, everything
- Language can be chosed with-out quitting the game
- More translation packs should be created to allow support for more languages

== Names ==

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be L-espanol0.PK3.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc. As [[Darkplaces Virtual file system works|Darkplaces File System]] - files with same paths gets replaced.

== Contents of translation pack ==

== Encoding ==

== Howto make a translation ==

== Sample Packs ==</text>
    </revision>
    <revision>
      <id>18</id>
      <timestamp>2012-07-02T13:13:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="899">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Contents of translation pack ==

== Encoding ==

== Howto make a translation ==

== Sample Packs ==</text>
    </revision>
    <revision>
      <id>19</id>
      <timestamp>2012-07-02T13:24:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="1757">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

== Encoding ==

== Howto make a translation ==

== Sample Packs ==</text>
    </revision>
    <revision>
      <id>20</id>
      <timestamp>2012-07-02T13:26:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Howto make a translation */</comment>
      <text xml:space="preserve" bytes="2045">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

== Encoding ==

== Howto make a translation ==

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample Packs ==</text>
    </revision>
    <revision>
      <id>21</id>
      <timestamp>2012-07-02T13:30:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample Packs */</comment>
      <text xml:space="preserve" bytes="2548">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

== Encoding ==

== Howto make a translation ==

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

Here is the list of reference locale packs that you can use as a base:
==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>22</id>
      <timestamp>2012-07-02T13:31:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Encoding */</comment>
      <text xml:space="preserve" bytes="2659">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

== Text files ==

All text files should use UTF-8 encoding with no BOM. 

Programs which can edit them:
* Notepad++
* AkelPad

== Howto make a translation ==

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

Here is the list of reference locale packs that you can use as a base:
==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>23</id>
      <timestamp>2012-07-02T13:34:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2740">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

= Howto make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

Here is the list of reference locale packs that you can use as a base:
== Blood Omnicide Demo ==
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
== Blood Omnicide v0.1  ==

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>24</id>
      <timestamp>2012-07-02T13:35:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2775">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

= Howto make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>25</id>
      <timestamp>2012-07-02T13:36:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2776">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

:Standart naming for locale file is L-localename0.PK3, where localename is language identificator. Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.
:A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>27</id>
      <timestamp>2012-07-02T13:43:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Names */</comment>
      <text xml:space="preserve" bytes="2776">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is L-localename0.PK3, where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>28</id>
      <timestamp>2012-07-02T13:45:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="2814">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is L-localename0.PK3, where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT|.QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS|.DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>37</id>
      <timestamp>2012-07-02T14:40:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Translating]] to [[Translation]]: Misspelled</comment>
      <text xml:space="preserve" bytes="2814">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is L-localename0.PK3, where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT|.QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS|.DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>41</id>
      <timestamp>2012-07-02T15:00:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Names */</comment>
      <text xml:space="preserve" bytes="2820">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Note: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT|.QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS|.DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>42</id>
      <timestamp>2012-07-02T15:01:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Text encoding */</comment>
      <text xml:space="preserve" bytes="2823">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT|.QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS|.DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>43</id>
      <timestamp>2012-07-02T15:02:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="2830">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT|.QFONT files]])
**** '''maps/''' - map translation strings (see [[.NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS|.DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>73</id>
      <timestamp>2012-07-02T18:09:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="2839">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[.QFONT files | QFONT]])
**** '''maps/''' - map translation strings (see [[.NSX files | NSX ]])
**** '''video/'''- subtitles translation for FMV' (see [[.DPSUBS files DPSUBS]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>74</id>
      <timestamp>2012-07-02T18:09:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="2840">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 files|PK3]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>78</id>
      <timestamp>2012-07-02T18:11:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Introduction */</comment>
      <text xml:space="preserve" bytes="2843">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - translation strings for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>85</id>
      <timestamp>2012-07-02T18:20:16Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="2874">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[Translation_string_files | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>88</id>
      <timestamp>2012-07-02T18:21:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2880">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

==== Blood Omnicide Demo ====
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
==== Blood Omnicide v0.1  ====

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>89</id>
      <timestamp>2012-07-02T18:22:32Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample locale packs */</comment>
      <text xml:space="preserve" bytes="2878">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

---- Blood Omnicide Demo ----
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
---- Blood Omnicide v0.1  ----

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>90</id>
      <timestamp>2012-07-02T18:22:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample locale packs */</comment>
      <text xml:space="preserve" bytes="2878">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

'''' Blood Omnicide Demo ''''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
'''' Blood Omnicide v0.1  ''''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>91</id>
      <timestamp>2012-07-02T18:22:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample locale packs */</comment>
      <text xml:space="preserve" bytes="2874">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

Warning: UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo '''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>95</id>
      <timestamp>2012-07-02T18:24:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Text encoding */</comment>
      <text xml:space="preserve" bytes="2880">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download base pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo '''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>96</id>
      <timestamp>2012-07-02T18:25:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* How to make a translation */</comment>
      <text xml:space="preserve" bytes="2882">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate ui.ns2;
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo '''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>97</id>
      <timestamp>2012-07-02T18:27:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* How to make a translation */</comment>
      <text xml:space="preserve" bytes="3049">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[QFONT | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo '''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>121</id>
      <timestamp>2012-07-02T18:58:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="3055">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo '''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>221</id>
      <timestamp>2012-07-03T06:29:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample locale packs */</comment>
      <text xml:space="preserve" bytes="3086">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo (Using old transpation layout) '''
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>222</id>
      <timestamp>2012-07-03T06:30:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample locale packs */</comment>
      <text xml:space="preserve" bytes="3086">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]
''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]</text>
    </revision>
    <revision>
      <id>223</id>
      <timestamp>2012-07-03T06:30:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Sample locale packs */</comment>
      <text xml:space="preserve" bytes="3087">
= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>653</id>
      <timestamp>2012-07-15T01:37:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3108">{{article outdated}}

= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>660</id>
      <timestamp>2012-07-15T01:43:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3107">{{article ancient}}

= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>690</id>
      <timestamp>2012-07-15T02:05:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3086">= Introduction =

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

= Names =

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

= Text encoding =

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

= Contents of translation pack =

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

= How to make a translation =

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

= Sample locale packs =
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>1038</id>
      <timestamp>2012-07-17T20:28:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3098">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | .PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

== How to make a translation ==

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>1040</id>
      <timestamp>2012-07-17T20:28:53Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3097">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | .QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | .NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | .DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|.NS2 files]])

== How to make a translation ==

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>1041</id>
      <timestamp>2012-07-17T20:29:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Contents of translation pack */</comment>
      <text xml:space="preserve" bytes="3093">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old transpation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>2060</id>
      <timestamp>2012-07-27T18:18:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>fix a typo</comment>
      <text xml:space="preserve" bytes="3093">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]</text>
    </revision>
    <revision>
      <id>2213</id>
      <timestamp>2012-07-30T07:50:51Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3107">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2632</id>
      <timestamp>2012-08-10T06:31:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* How to make a translation */</comment>
      <text xml:space="preserve" bytes="3185">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use UTF-8 encoding with no BOM (Byte-Order-Mark). 

'''Warning''': UTF-8 files with BOM can crash engine or lead to unexpected results.

Programs which can edit them:
* Notepad++
* AkelPad

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you wi;; have access to all files
# Rename it to your language
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2636</id>
      <timestamp>2012-08-10T14:21:10Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3409">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Programs which can edit text files in Unicode:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you wi;; have access to all files
# Rename it to your language
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2637</id>
      <timestamp>2012-08-10T14:25:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Text encoding */</comment>
      <text xml:space="preserve" bytes="3397">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you wi;; have access to all files
# Rename it to your language
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2638</id>
      <timestamp>2012-08-10T14:25:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* How to make a translation */</comment>
      <text xml:space="preserve" bytes="3397">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you will have access to all files
# Rename it to your language
# Find .TTF/.OTF that matches your language and place them to the pack;
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2639</id>
      <timestamp>2012-08-10T14:26:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* How to make a translation */</comment>
      <text xml:space="preserve" bytes="3427">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you will have access to all files
# Rename it to your language
# Find .TTF/.OTF fonts that matches your language and place them to the pack (replace default fonts);
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2640</id>
      <timestamp>2012-08-30T17:38:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="4357">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you will have access to all files
# Rename it to your language
# Find .TTF/.OTF fonts that matches your language and place them to the pack (replace default fonts);
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Interactive tags ==
There is two modes for speech subtitles - classic and interactive. Classic mode shows subtitles at the bottom of the screen, interactive subtitles are drawn ontop of NPC they are spoken by.

Interactive mode is a bit different in representation, so there is special tags to let speech to be shown best way in classic and interactive mode:

* {text} - will be only shown in classic mode
* [text] - will be only shown in interactive mode
* &lt;number&gt; - time marker for interactive subtitles parts. &quot;some&lt;2&gt;speech&quot; will make subtiles to be rendered as two parts, with second part to be shown 2 seconds since speech was started.

== Testing speech in game ==
cl_cmd playspeech &lt;type&gt; &lt;character&gt; &lt;number&gt; [[Console|console]] command helps to test any speech available at current map.

Types are:
*speech - standart speech
*whisp - voice 'in head of kain' (like mortanius comments), always player in classic mode

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2641</id>
      <timestamp>2012-08-30T17:39:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Testing speech in game */</comment>
      <text xml:space="preserve" bytes="4366">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you will have access to all files
# Rename it to your language
# Find .TTF/.OTF fonts that matches your language and place them to the pack (replace default fonts);
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Interactive tags ==
There is two modes for speech subtitles - classic and interactive. Classic mode shows subtitles at the bottom of the screen, interactive subtitles are drawn ontop of NPC they are spoken by.

Interactive mode is a bit different in representation, so there is special tags to let speech to be shown best way in classic and interactive mode:

* {text} - will be only shown in classic mode
* [text] - will be only shown in interactive mode
* &lt;number&gt; - time marker for interactive subtitles parts. &quot;some&lt;2&gt;speech&quot; will make subtiles to be rendered as two parts, with second part to be shown 2 seconds since speech was started.

== Testing speech in game ==
{{cmd|cl_cmd playspeech &lt;type&gt; &lt;character&gt; &lt;number&gt;| [[Console|console]] command helps to test any speech available at current map.}}

Types are:
*speech - standart speech
*whisp - voice 'in head of kain' (like mortanius comments), always player in classic mode

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2643</id>
      <timestamp>2012-08-30T17:40:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Testing speech in game */</comment>
      <text xml:space="preserve" bytes="4358">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you will have access to all files
# Rename it to your language
# Find .TTF/.OTF fonts that matches your language and place them to the pack (replace default fonts);
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Interactive tags ==
There is two modes for speech subtitles - classic and interactive. Classic mode shows subtitles at the bottom of the screen, interactive subtitles are drawn ontop of NPC they are spoken by.

Interactive mode is a bit different in representation, so there is special tags to let speech to be shown best way in classic and interactive mode:

* {text} - will be only shown in classic mode
* [text] - will be only shown in interactive mode
* &lt;number&gt; - time marker for interactive subtitles parts. &quot;some&lt;2&gt;speech&quot; will make subtiles to be rendered as two parts, with second part to be shown 2 seconds since speech was started.

== Testing speech in game ==
{{cmd|cl_cmd playspeech &lt;type&gt; &lt;character&gt; &lt;number&gt;| [[console]] command helps to test any speech available at current map.}}

Types are:
*speech - standart speech
*whisp - voice 'in head of kain' (like mortanius comments), always player in classic mode

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
    <revision>
      <id>2671</id>
      <timestamp>2012-09-25T15:46:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Interactive tags */</comment>
      <text xml:space="preserve" bytes="4365">== Introduction ==

Blood Omnicide support translation packs in the form of separate [[PK3 | PK3 files]]. 

This article will explain how to edit them, creating your own localization pack.

Translation packs follows this rules:

* Translate texts, textures, sounds, everything

* Language can be chosen without quitting the game

* More translation packs should be created to allow support for more languages

== Names ==

Standart naming for locale file is '''L-localename0.PK3''', where localename is language identificator.

Example: localname is &quot;espanol&quot; and pack name will be '''L-espanol0.PK3'''.

A number in the end is used to break up locale to separate PK3 files (or make update pack later), engine reads them in the order: '''L-espanol0.PK3''', '''L-espanol1.PK3''', '''L-espanol2.PK3''' etc.

== Text encoding ==

All text files should use Unicode (UTF-8) encoding with no BOM (Byte-Order-Mark). 

{{important|National encodings (ones Windows Notepad uses) are not suppored. All files should be in Unicode.}}

{{bug|It is also important UTF-8 files to have no BOM, avoiding this rule could lead to engine crash.}}

Tools to edit text files in UTF-8:
* [http://notepad-plus-plus.org/ Notepad++]
* [http://akelpad.sourceforge.net AkelPad]

== Contents of translation pack ==

* '''kain''' - base folder
** '''locales'''
*** ''localename.nsx'' - heading locale script
*** ''localename.tga'' - а picture to show in the locale selection menu
*** '''locale/''' - general locales folder
**** '''localename/''' - base locale folder
**** '''fonts/''' - font definition files and font faces (see [[NSX_(QFont) | QFONT files]])
**** '''maps/''' - map translation strings (see [[NSX | NSX files]])
**** '''video/'''- subtitles translation for FMV' (see [[DPSUBS | DPSUBS files]])
**** ''credits.nsx'' - [[NSX (Translation string files) | translation strings]] for credits
**** ''gameover.nsx'' - translation strings for game over screen
**** ''gamestats.nsx'' - translation strings for game stats
**** ''menu.nsx'' - translation strings for menus
**** ''prestige.nsx'' - translation strings for prestige status
**** ''speech.nsx'' - translation strings for speech
**** ''ui.ns2'' - user interface initialization (see [[NS2|NS2 files]])

== How to make a translation ==

# Download sample pack;
# Unpack it so you will have access to all files
# Rename it to your language
# Find .TTF/.OTF fonts that matches your language and place them to the pack (replace default fonts);
# Translate all strings files (.nsx);
# Translate cinematics subtitles (.dpsubs)
# Translate ui.ns2;
# Create translated worldmap tile
# Create a picture to show in the locale selection menu;
# Edit heading locale script (set author and version);
# (Optional) Add dialogue override files
# (Optional) Add cinematics sound override files
# Make a [[PK3]] file;

== Speech interactive tags ==
There is two modes for speech subtitles - classic and interactive. Classic mode shows subtitles at the bottom of the screen, interactive subtitles are drawn ontop of NPC they are spoken by.

Interactive mode is a bit different in representation, so there is special tags to let speech to be shown best way in classic and interactive mode:

* {text} - will be only shown in classic mode
* [text] - will be only shown in interactive mode
* &lt;number&gt; - time marker for interactive subtitles parts. &quot;some&lt;2&gt;speech&quot; will make subtiles to be rendered as two parts, with second part to be shown 2 seconds since speech was started.

== Testing speech in game ==
{{cmd|cl_cmd playspeech &lt;type&gt; &lt;character&gt; &lt;number&gt;| [[console]] command helps to test any speech available at current map.}}

Types are:
*speech - standart speech
*whisp - voice 'in head of kain' (like mortanius comments), always player in classic mode

== Sample locale packs ==
Here is the list of reference locale packs that you can use as a base:

''' Blood Omnicide v0.1  '''

:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/0.1/locales/L-default0.PK3 download]

''' Blood Omnicide Demo ''' (Using old translation layout)
:English: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-default0.PK3 download]

:Russian: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-ru-RU0.PK3 download]

:Espanol: [http://omnicide.legacy-of-kain.ru/files/omnicide/demo/locales/L-es_ES0.PK3 download]

{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Trigger event</title>
    <ns>0</ns>
    <id>18</id>
      <sha1>c5a10an9moxvb3kuv2nkeylpiins7vh</sha1>
    <revision>
      <id>163</id>
      <timestamp>2012-07-02T21:35:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;CallTargets  * &quot;nocall&quot; targetparm do cancel call * If targetparm not begins with &quot;select&quot;, &quot;select targets;&quot; is automatically added * Empty targetparm defaults to &quot;select tar...&quot;</comment>
      <text xml:space="preserve" bytes="1003">CallTargets

* &quot;nocall&quot; targetparm do cancel call
* If targetparm not begins with &quot;select&quot;, &quot;select targets;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[MASK:]''CALL ==</text>
    </revision>
    <revision>
      <id>164</id>
      <timestamp>2012-07-02T21:59:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1054">Target paremeter

* &quot;nocall&quot; targetparm do cancel call
* If targetparm not begins with &quot;select&quot;, &quot;select targets;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>165</id>
      <timestamp>2012-07-02T22:12:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1501">Call event is most useful event. 
It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call even under it's own circumstances.
But structure of event is same all the time.

Call event takes input:

* activator entity - who lets event go
* call entity - entity call is being processed on
* call parameters - instructions for call event, fetched from &quot;targetparm&quot; field of call entity.

After input got fetches, 

* &quot;nocall&quot; parameter breaks call event
* If targetparm not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>166</id>
      <timestamp>2012-07-02T22:12:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1502">Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call even under it's own circumstances.

But structure of event is same all the time.

Call event takes input:

* activator entity - who lets event go
* call entity - entity call is being processed on
* call parameters - instructions for call event, fetched from &quot;targetparm&quot; field of call entity.

After input got fetches, 

* &quot;nocall&quot; parameter breaks call event
* If targetparm not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>167</id>
      <timestamp>2012-07-02T22:12:47Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1513">Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call even under it's own circumstances.

But structure of event is same all the time.

===== Call event takes input =====

* activator entity - who lets event go
* call entity - entity call is being processed on
* call parameters - instructions for call event, fetched from &quot;targetparm&quot; field of call entity.

After input got fetches, 

* &quot;nocall&quot; parameter breaks call event
* If targetparm not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>168</id>
      <timestamp>2012-07-02T22:13:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1507">Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call even under it's own circumstances.

But structure of event is same all the time.

'''Call event takes input'''

* activator entity - who lets event go
* call entity - entity call is being processed on
* call parameters - instructions for call event, fetched from &quot;targetparm&quot; field of call entity.

After input got fetches, 

* &quot;nocall&quot; parameter breaks call event
* If targetparm not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>169</id>
      <timestamp>2012-07-02T22:13:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1511">Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call even under it's own circumstances.

But structure of event is same all the time.

'''Call event takes input:'''

* activator entity - who lets event go
* call entity - entity call is being processed on
* call parameters - instructions for call event, fetched from &quot;targetparm&quot; field of call entity.

'''Call parameters rules:'''

* &quot;nocall&quot; parameter breaks call event
* If targetparm not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty targetparm defaults to &quot;select targets;call&quot;

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>170</id>
      <timestamp>2012-07-02T22:15:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1623">= CALL EVENT BASICS =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call even under it's own circumstances.

But structure of event is same all the time.

'''Call event takes input:'''

* activator entity - who lets event go
* call entity - entity call is being processed on
* call parameters - instructions for call event, fetched from &quot;targetparm&quot; field of call entity.

'''Call parameters rules:'''

* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* NOCALL instruction breaks call event
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= INSTRUCTIONS =

== SELECT / ADD ==

Starts and expands selection of entities, which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate infoportions on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== ''[mask:]action'' ==

Call all selected entities with parameter.</text>
    </revision>
    <revision>
      <id>171</id>
      <timestamp>2012-07-02T22:22:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1980">= Call event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event takes input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* NOCALL instruction breaks call event
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

== SELECT/ADD ==

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== [CLASSNAME:]CALL ==

This calls all selected entities with their default action.

Can filter this event by classname, if it's presented, only selected entities matching classname will be processed.

Example: select targets;effect_light:call

== [CLASSNAME:]OTHER ACTIONS ==

This calls all selected entities with custom action.

Classname</text>
    </revision>
    <revision>
      <id>172</id>
      <timestamp>2012-07-02T22:23:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* [CLASSNAME:]ACTIONS */</comment>
      <text xml:space="preserve" bytes="1981">= Call event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event takes input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* NOCALL instruction breaks call event
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

== SELECT/ADD ==

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== [CLASSNAME:]CALL ==

This calls all selected entities with their default action.

Can filter this event by classname, if it's presented, only selected entities matching classname will be processed.

Example: select targets;effect_light:call

== [CLASSNAME:]''SOMEACTION'' ==

This calls all selected entities with custom action.

Classname</text>
    </revision>
    <revision>
      <id>173</id>
      <timestamp>2012-07-02T22:27:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2023">= Call event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event takes input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;select&quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

== SELECT/ADD ==

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''id1 id2 id3 ... idX'' - select entities by their save id's
* SELECT BYTARGETNAME ''targetname1 targetname2 ... targetnameX'' - select entities by their save id's

== INFOPORTION ==

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== [CLASSNAME:]CALL ==

This calls all selected entities with their default action.

Can filter this event by classname, if it's presented, only selected entities matching classname will be processed.

Example: select targets;effect_light:call

== [CLASSNAME:]SOMEACTION ==

This calls all selected entities with custom action. Action should be selected from object's definition.

== BREAK ==

Immediately exits call event.</text>
    </revision>
    <revision>
      <id>174</id>
      <timestamp>2012-07-02T22:34:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1988">= Call event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

== SELECT/ADD ==

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

== INFOPORTION &lt;OPERATOR&gt; ==

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== [CLASSNAME:]CALL / [CLASSNAME:]&lt;CUSTOMACTION&gt; ==

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can filter this event by classname, in this case only selected entities matching classname will be processed.

 Example: select targets;effect_light:call

== BREAK or NOCALL ==

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>175</id>
      <timestamp>2012-07-02T22:39:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2012">= Call event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

== SELECT/ADD ==

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

== INFOPORTION &lt;OPERATOR&gt; ==

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

== CALL / &lt;CUSTOM ACTION&gt; ==

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

== BREAK or NOCALL ==

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>176</id>
      <timestamp>2012-07-02T22:39:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2020">= Call event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

=== SELECT/ADD ===

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

=== INFOPORTION &lt;OPERATOR&gt; ===

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

=== CALL / &lt;CUSTOM ACTION&gt; ===

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

=== BREAK or NOCALL ===

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>177</id>
      <timestamp>2012-07-02T22:40:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2015">= Event basics =

Call event is most useful event.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

=== SELECT/ADD ===

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

=== INFOPORTION &lt;OPERATOR&gt; ===

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

=== CALL / &lt;CUSTOM ACTION&gt; ===

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

=== BREAK or NOCALL ===

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>178</id>
      <timestamp>2012-07-02T22:40:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2064">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

=== SELECT/ADD ===

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

=== INFOPORTION &lt;OPERATOR&gt; ===

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

=== CALL / &lt;CUSTOM ACTION&gt; ===

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

=== BREAK or NOCALL ===

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>179</id>
      <timestamp>2012-07-02T22:41:22Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Target parms]] to [[Call event]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="2064">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call parameters instructions string not begins with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

=== SELECT/ADD ===

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

=== INFOPORTION &lt;OPERATOR&gt; ===

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

=== CALL / &lt;CUSTOM ACTION&gt; ===

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

=== BREAK or NOCALL ===

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>181</id>
      <timestamp>2012-07-02T22:48:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2045">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

=== SELECT/ADD ===

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

=== INFOPORTION &lt;OPERATOR&gt; ===

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

=== CALL / &lt;CUSTOM ACTION&gt; ===

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

=== BREAK or NOCALL ===

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>182</id>
      <timestamp>2012-07-02T22:48:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2047">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

=== SELECT/ADD ===

Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's

=== INFOPORTION &lt;OPERATOR&gt; ===

Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)

=== CALL / &lt;CUSTOM ACTION&gt; ===

This calls all selected entities with their default action (call) or custom action supported by it's class.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call

=== BREAK or NOCALL ===

Immediately exit call event.</text>
    </revision>
    <revision>
      <id>183</id>
      <timestamp>2012-07-02T22:54:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2255">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=25% | Syntax
! width=73% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.
|-
| 4
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>184</id>
      <timestamp>2012-07-02T22:54:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2264">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=25% | Syntax
! width=73% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.
|-
| 4
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>185</id>
      <timestamp>2012-07-02T22:54:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2264">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=20% | Syntax
! width=78% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.
|-
| 4
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>186</id>
      <timestamp>2012-07-02T22:54:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2264">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=20% | Syntax
! width=78% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>187</id>
      <timestamp>2012-07-02T22:54:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2264">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>188</id>
      <timestamp>2012-07-02T22:56:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2354">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - adds/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>189</id>
      <timestamp>2012-07-02T22:56:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2353">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like call, but action is one of object's supported custom call parameters.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>190</id>
      <timestamp>2012-07-02T22:57:20Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2353">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| This is actually much like CALL, but action is one of object's supported custom call parameters.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>191</id>
      <timestamp>2012-07-02T22:58:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2334">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

'''Call event input:'''

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

'''Call parameters rules:'''

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;



= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>192</id>
      <timestamp>2012-07-02T22:59:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Event basics */</comment>
      <text xml:space="preserve" bytes="2319">= Event basics =

Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>193</id>
      <timestamp>2012-07-02T22:59:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2301">Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=100% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>194</id>
      <timestamp>2012-07-02T22:59:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2300">Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>195</id>
      <timestamp>2012-07-02T23:00:07Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2313">Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% align=center | Order
! width=10% | Syntax
! width=88% | Description
|-
| 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>196</id>
      <timestamp>2012-07-02T23:00:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2375">Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>370</id>
      <timestamp>2012-07-10T18:37:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Call event]] to [[Trigger event]]: misspelled</comment>
      <text xml:space="preserve" bytes="2375">Call event is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity call is being processed on
* activator - who lets event go (usually player or monster)
* parameters - instructions for call event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If call instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This calls all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case call event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom call actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit call event.
|}</text>
    </revision>
    <revision>
      <id>373</id>
      <timestamp>2012-07-10T18:40:06Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2419">Trigger event (verb ''to trigger'') is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}</text>
    </revision>
    <revision>
      <id>377</id>
      <timestamp>2012-07-12T05:14:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3181">Trigger event (verb ''to trigger'') is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it, sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| colspan=3 | '''Common item keys'''
|-
| Target
| target
| This entity till be triggered when item is picked.
|-
| Target parameters
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered. If target is set, item will perform spawn move from the center of it's targeter.
|}</text>
    </revision>
    <revision>
      <id>378</id>
      <timestamp>2012-07-12T05:14:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3183">Trigger event (verb ''to trigger'') is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it, sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| colspan=3 | '''Common item keys'''
|-
| Target
| target
| This entity till be triggered when item is picked.
|-
| Target parameters
| targetparm
| Instructions for trigger event; Type &quot;nocall&quot; here to disable trigger event.
|-
| Targetname
| targetname
| If set, item becomes hidden and got spawned when triggered. If target is set, item will perform spawn move from the center of it's targeter.
|}</text>
    </revision>
    <revision>
      <id>379</id>
      <timestamp>2012-07-12T05:17:33Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3079">Trigger event (verb ''to trigger'') is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}</text>
    </revision>
    <revision>
      <id>380</id>
      <timestamp>2012-07-12T05:17:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3090">Trigger event (verb ''to trigger'') is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>381</id>
      <timestamp>2012-07-12T05:18:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3096">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game aspects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>382</id>
      <timestamp>2012-07-12T05:18:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3096">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>383</id>
      <timestamp>2012-07-12T05:18:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3096">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

It happens when trigger get touched, on monster dies. Each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>384</id>
      <timestamp>2012-07-12T05:19:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3097">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

It happens when trigger get touched, on monster dies. Each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their save id's
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>385</id>
      <timestamp>2012-07-12T05:19:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="3098">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

It happens when trigger get touched, on monster dies. Each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{| cellspacing=0 cellpadding=5 border=1 style=&quot;border-collapse: collapse&quot;
! width=10% | Name
! width=10% | Key
! width=70% | Description
! width=10% | Default value
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
|}

__NOTOC__</text>
    </revision>
    <revision>
      <id>713</id>
      <timestamp>2012-07-15T02:17:11Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2970">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

It happens when trigger get touched, on monster dies. Each object can have it's own behavior and launch trigger event under it's own circumstances.

But structure of event is same all the time.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>972</id>
      <timestamp>2012-07-16T21:31:24Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3075">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>973</id>
      <timestamp>2012-07-16T21:31:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3076">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. 
Not only buttons can trigger things, for example enemy could open a door when dies.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>974</id>
      <timestamp>2012-07-16T21:31:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3075">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>975</id>
      <timestamp>2012-07-16T21:34:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3260">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between many game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|-
| align=center | 6
| ?
| Each entity class can have special call parameters. Like doors have directives to open and close, enemies can change their path or spawn in special origin.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>976</id>
      <timestamp>2012-07-17T05:00:30Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3255">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies.

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot; - &quot;SELECT TARGETS;&quot; is automatically added
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|-
| align=center | 6
| ?
| Each entity class can have special call parameters. Like doors have directives to open and close, enemies can change their path or spawn in special origin.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>977</id>
      <timestamp>2012-07-17T05:04:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3331">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|-
| align=center | 6
| ?
| Each entity class can have special call parameters. Like doors have directives to open and close, enemies can change their path or spawn in special origin.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>978</id>
      <timestamp>2012-07-17T05:05:27Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3275">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|-
| align=center | 6
| ?
| Each entity class can have special call parameters. Like doors have directives to open and close, enemies can change their path or spawn in special origin.
|}


= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>979</id>
      <timestamp>2012-07-17T05:06:59Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="3090">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% | Order
! width=10% | Syntax
! width=88% | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>1010</id>
      <timestamp>2012-07-17T05:39:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3138">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


= Instructions =

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEDFDF | Order
! width=10% bgcolor=#EEDFDF | Syntax
! width=88% bgcolor=#EEDFDF | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

= Event keys =

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>1059</id>
      <timestamp>2012-07-17T20:41:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3142">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEDFDF | Order
! width=10% bgcolor=#EEDFDF | Syntax
! width=88% bgcolor=#EEDFDF | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFOPORTION SET ''infoportion'' - add/update infoportion
* INFOPORTION DEL ''infoportion'' - delete infoportion
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>1092</id>
      <timestamp>2012-07-17T22:47:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3114">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEDFDF | Order
! width=10% bgcolor=#EEDFDF | Syntax
! width=88% bgcolor=#EEDFDF | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFO SET ''infoportion'' - add/update infoportion
* INFO DEL ''infoportion'' - delete infoportion
* INFO INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFO DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>1098</id>
      <timestamp>2012-07-17T22:54:41Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3105">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEE | Order
! width=10% bgcolor=#EEE | Syntax
! width=88% bgcolor=#EEE | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFO SET ''infoportion'' - add/update infoportion
* INFO DEL ''infoportion'' - delete infoportion
* INFO INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFO DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

__NOTOC__</text>
    </revision>
    <revision>
      <id>1131</id>
      <timestamp>2012-07-17T23:33:58Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3144">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEE | Order
! width=10% bgcolor=#EEE | Syntax
! width=88% bgcolor=#EEE | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFO SET ''infoportion'' - add/update infoportion
* INFO DEL ''infoportion'' - delete infoportion
* INFO INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFO DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern scripts]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1132</id>
      <timestamp>2012-07-17T23:34:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3160">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

{| width=85% cellspacing=0 cellpadding=4 border=1 style=&quot;border-collapse: collapse&quot;
! width=2% bgcolor=#EEE | Order
! width=10% bgcolor=#EEE | Syntax
! width=88% bgcolor=#EEE | Description
|-
| align=center | 1
| SELECT/ADD
| Starts (select) or expands (add) selection of [[Entity | entities]].

* SELECT TARGETS - select entity to which i'm targeted
* SELECT TARGETERS - select entities which are targeted to me
* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames
|-
| align=center | 2
| INFOPORTION &lt;OPERATOR&gt;
| Manipulate [[Infoportion | infoportions]] on activator.

* INFO SET ''infoportion'' - add/update infoportion
* INFO DEL ''infoportion'' - delete infoportion
* INFO INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
* INFO DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
|-
| align=center | 3
| CALL
| This triggers all selected entities with their default action.

Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.

Examples:

 select targets;effect_light:call

 select byid 145;call
|-
| align=center | 4
| &lt;CUSTOM ACTION&gt;
| One of object's supported custom trigger actions. Classname filter is supported.

Examples:

 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
|-
| align=center | 5
| BREAK or NOCALL
| Immediately exit trigger event.
|}

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1149</id>
      <timestamp>2012-07-17T23:49:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2908">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportion | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
:
 select targets;effect_light:call
:
 select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1150</id>
      <timestamp>2012-07-17T23:50:02Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2909">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
:
 select targets;effect_light:call
:
 select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1151</id>
      <timestamp>2012-07-17T23:50:15Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2911">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
:
: select targets;effect_light:call
:
: select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1152</id>
      <timestamp>2012-07-17T23:50:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2915">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::
:: select targets;effect_light:call
::
:: select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1153</id>
      <timestamp>2012-07-17T23:50:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2909">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:

 :select targets;effect_light:call

 :select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1154</id>
      <timestamp>2012-07-17T23:50:46Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2907">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:

 select targets;effect_light:call

 select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1155</id>
      <timestamp>2012-07-17T23:51:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2971">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
{{hidden begin : Examples}}

 select targets;effect_light:call

 select byid 145;call
{{hidden end}}

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
{{hidden begin : Examples}}
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
{{hidden end}}

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1156</id>
      <timestamp>2012-07-17T23:51:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2971">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
{{hidden begin | Examples}}

 select targets;effect_light:call

 select byid 145;call
{{hidden end}}

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
{{hidden begin | Examples}}
 select targets;effect_light:on

 select byid 145;trigger_puzzle:toggle 2 1 3
{{hidden end}}

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1157</id>
      <timestamp>2012-07-17T23:52:40Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2908">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;


== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1158</id>
      <timestamp>2012-07-17T23:52:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2907">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator.
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1160</id>
      <timestamp>2012-07-17T23:54:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Instructions */</comment>
      <text xml:space="preserve" bytes="2907">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

For Blood Omnicide, trigger event was extended to allow custom instructions. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1782</id>
      <timestamp>2012-07-26T10:43:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>modified description</comment>
      <text xml:space="preserve" bytes="2954">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1783</id>
      <timestamp>2012-07-26T10:44:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>qu</comment>
      <text xml:space="preserve" bytes="3028">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* ';' is the separator between instructions
* Instruction keywords are separated by space and TAB (except for braces)
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>1784</id>
      <timestamp>2012-07-26T10:45:01Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>changed event rules</comment>
      <text xml:space="preserve" bytes="3028">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* Instruction keywords are separated by space and TAB (except for braces)
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]


__NOTOC__</text>
    </revision>
    <revision>
      <id>2314</id>
      <timestamp>2012-07-30T21:58:48Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3059">{{need screenshot}}
Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* Instruction keywords are separated by space and TAB (except for braces)
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2315</id>
      <timestamp>2012-07-30T21:58:56Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3039">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* Instruction keywords are separated by space and TAB (except for braces)
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2715</id>
      <timestamp>2012-10-07T10:19:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Event keys */</comment>
      <text xml:space="preserve" bytes="3054">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* Instruction keywords are separated by space and TAB (except for braces)
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior (if presented) is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]
* [[Zone event]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2851</id>
      <timestamp>2012-11-22T11:34:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3038">Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

=== Event input ===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

=== Event rules ===

* Instructions are case insensative
* Instruction keywords are separated by space and TAB (except for braces)
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

== Instructions ==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

== Event keys ==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior (if presented) is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]

{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2902</id>
      <timestamp>2012-11-23T01:19:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3033">{{TOCRIGHT}}
Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.

Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event. 

===Event input===

* self - entity trigger event is being processed on
* activator - who lets event go (usually player)
* parameters - instructions for trigger event, fetched from &quot;targetparm&quot; field of self.

===Event rules===

* Instructions are case insensative
* Instruction keywords are separated by space and TAB (except for braces)
* ';' is the separator between instructions
* If trigger instructions not begin with &quot;SELECT &quot;, scripts automatically executes &quot;SELECT TARGETS&quot; at beginning.
* Empty instructions defaults to &quot;SELECT TARGETS;CALL&quot;

==Instructions==

'''SELECT/ADD'''
:Starts (select) or expands (add) selection of [[Entity | entities]].
:* SELECT TARGETS - select entity to which i'm targeted
:* SELECT TARGETERS - select entities which are targeted to me
:* SELECT BYID ''&lt;id1&gt; &lt;id2&gt; &lt;id3&gt; ... &lt;idX&gt;'' - select entities by their save id's
:* SELECT BYTARGETNAME ''&lt;targetname1&gt; &lt;targetname2&gt; ... &lt;targetnameX&gt;'' - select entities by their targetnames

'''INFOPORTION ''OPERATOR'''''
:Manipulate [[Infoportions | infoportions]] on activator:
:* '''INFO SET''' ''infoportion'' - add/update infoportion
:* '''INFO DEL''' ''infoportion'' - delete infoportion
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)

'''CALL'''
:This triggers all selected entities with their default action.
:Can prefix this instruction with &lt;classname:&gt;. In this case trigger event will only be processed on entities with matching class name.
:Examples:
::select targets;effect_light:call
::select byid 145;call

'''''CUSTOM ACTION'''''
:One of object's supported custom trigger actions. Classname filter is supported.
:Examples:
::select targets;effect_light:on
::select byid 145;trigger_puzzle:toggle 2 1 3

'''BREAK or NOCALL'''
:Immediately exit trigger event.

==Event keys==

Trigger event have general keys that is used for it.

Sometimes this keys are used by other kind of events too. This special behavior (if presented) is defined in particular class reference.

{{entity fields}}
|-
| Target
| target
| All entities with matching targetname will be triggered.
|-
| Target parameters
| targetparm
| When entity is triggered, this is instructions for trigger event (see instructions above);
|-
| Targetname
| targetname
| Entities with matching target will trigger this entity.
{{entity fields end}}

== See also ==
* [[Pattern script]]

{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Tutorial: Modificare il percorso per le skin con MD3 Compiler</title>
    <ns>0</ns>
    <id>644</id>
    <redirect title="Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler" />
      <sha1>6p8xpuaicxrbuyvpf1ybxl2abm9vxkd</sha1>
    <revision>
      <id>3571</id>
      <timestamp>2013-01-31T14:53:22Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <comment>Makenor13 moved page [[Tutorial: Modificare il percorso per le skin con MD3 Compiler]] to [[Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler]]: It's an italian page</comment>
      <text xml:space="preserve" bytes="92">#REDIRECT [[Portal:InItalian/Tutorial: Modificare il percorso per le skin con MD3 Compiler]]</text>
    </revision>
  </page>
  <page>
    <title>Tutorials:Altering a material using NPherno MD3 Compiler</title>
    <ns>0</ns>
    <id>197</id>
      <sha1>aprqi2di3kmh1596dqgx0ejwh4i6uo9</sha1>
    <revision>
      <id>2336</id>
      <timestamp>2012-08-01T09:04:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{DISPLAYTITLE:Altering a skin-path using Npherno MD3 Compiler}} {{adopted |author=Tabun |source=http://www.tabun.nl/tutorials/md3skinpath_tutorial/ |Darkplaces engine }}  ==W...&quot;</comment>
      <text xml:space="preserve" bytes="3019">{{DISPLAYTITLE:Altering a skin-path using Npherno MD3 Compiler}}
{{adopted
|author=Tabun
|source=http://www.tabun.nl/tutorials/md3skinpath_tutorial/
|Darkplaces engine
}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_03.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]</text>
    </revision>
    <revision>
      <id>2343</id>
      <timestamp>2012-08-01T09:25:52Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2984">{{DISPLAYTITLE:Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|http://www.tabun.nl/tutorials/md3skinpath_tutorial/}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_03.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]</text>
    </revision>
    <revision>
      <id>2344</id>
      <timestamp>2012-08-01T09:26:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2994">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|http://www.tabun.nl/tutorials/md3skinpath_tutorial/}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_03.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]</text>
    </revision>
    <revision>
      <id>2345</id>
      <timestamp>2012-08-01T09:26:49Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3019">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|http://www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_03.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2349</id>
      <timestamp>2012-08-01T09:32:25Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Tutorials:Altering a skin-path using Npherno MD3 Compiler]] to [[Tutorials:Altering a material using Npherno MD3 Compiler]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="3019">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|http://www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_03.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2350</id>
      <timestamp>2012-08-01T09:32:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>VorteX moved page [[Tutorials:Altering a material using Npherno MD3 Compiler]] to [[Tutorials:Altering a material using NPherno MD3 Compiler]] without leaving a redirect</comment>
      <text xml:space="preserve" bytes="3019">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|http://www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_03.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2371</id>
      <timestamp>2012-08-01T14:13:34Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3019">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|http://www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2375</id>
      <timestamp>2012-08-01T14:22:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="3012">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
Ok, to recap what I've shown so far, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2378</id>
      <timestamp>2012-08-02T14:21:37Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Recap */</comment>
      <text xml:space="preserve" bytes="3011">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with the useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change a material of surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most. 

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
To recap the tutorial stated above, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2693</id>
      <timestamp>2012-09-28T12:55:54Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* What's this about? */</comment>
      <text xml:space="preserve" bytes="3012">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with a useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change the material of a surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most.

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've had to select more than one object in the import popup (see pic 2), there are more objects whose path may need editing.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
To recap the tutorial stated above, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2694</id>
      <timestamp>2012-09-28T13:06:28Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <comment>/* Step 2: Altering the material */</comment>
      <text xml:space="preserve" bytes="3010">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with a useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change the material of a surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most.

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've selected more than one object in the import pop-up (see pic 2), there might be objects with a path need to be edited.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A popup will show, asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

That's all there is to it. 

==Recap==
To recap the tutorial stated above, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2695</id>
      <timestamp>2012-09-28T13:07:50Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <minor/>
      <comment>/* Step 3: Final step */</comment>
      <text xml:space="preserve" bytes="2987">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with a useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change the material of a surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most.

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've selected more than one object in the import pop-up (see pic 2), there might be objects with a path need to be edited.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all the objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A pop-up will appear asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

==Recap==
To recap the tutorial stated above, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2696</id>
      <timestamp>2012-09-28T13:11:06Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="3001">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar checked|darth}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with a useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change the material of a surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most.

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've selected more than one object in the import pop-up (see pic 2), there might be objects with a path need to be edited.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all the objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A pop-up will appear asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

==Recap==
To recap the tutorial stated above, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2907</id>
      <timestamp>2012-11-23T01:28:09Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3014">{{DISPLAYTITLE:Tutorial: Altering a skin-path using Npherno MD3 Compiler}}
{{imported|Tabun|www.tabun.nl/tutorials/md3skinpath_tutorial/}}
{{grammar checked|darth}}
{{TOCRIGHT}}

==Whats needed==
* [[MD3 Compiler|Npherno's MD3 compiler]]
* An MD3 model

==What's this about?==
This tutorial gets you acquainted with a useful and concise tool titled 'Npherno's MD3 Compiler', which can be used to alter MD3 models. More specifically, it shows you exactly how to set or change the material of a surface.

[[Darkplaces material system|Materialnames]] are stored in the MD3's themselves. When the game loads a model, it uses the embedded material name to load the proper material or texture.

Altering MD3's can be tricky at first, but it's rather easy and doesn't take more than half a minute at most.

==Step 1: Importing objects==
Launch the MD3 Compiler. It's the &quot;MD3Compile.exe&quot; file.
This is what you'll see:

[[File:Tutorial_md3_01.jpg|Pic 1. MD3 Compiler window]]

Now, click the button labeled &quot;Import objects&quot;, and select the MD3 you wish to alter.
It shows the following popup:

[[File:Tutorial_md3_02.jpg|Pic 2. Importing an MD3]]

Select all parts of the model, and click &quot;OK&quot;.
The model should now appear in the center as a red and blue set of objects.

[[File:Tutorial_md3_03.jpg|Pic 3. Imported model]]

The window should look something like pic 3.
{{important|Now, click the &quot;All&quot; button (located directly above &quot;Import objects&quot;). Make sure the checkbox in pic 4 is checked before you proceed!}}

[[File:Tutorial_md3_04.jpg|Pic 4. After clicking &quot;All&quot;]]

==Step 2: Altering the material==
Now we can alter the material of any of the imported objects.
Usually, you'll find the MD3 only has one object. If you've selected more than one object in the import pop-up (see pic 2), there might be objects with a path need to be edited.

Use the top-most dropdown-list to select an object (in this case, we can see that w_nailgun has been selected). The embedded path to the skin will be shown in the field immediately below it. You can edit the path now. 
{{important|Remember to always use forward slashes in paths. No matter what the original path shows, use forward slashes. Failure to do so means you won't see a texture in-game.}}
{{tip|If you are change material to empty or malicious string (like ''&lt;nowiki&gt;%@#====6%$!!!!  ----&lt;/nowiki&gt;'') it will not be drawn}}

==Step 3: Final step==
Once you've edited the paths of all the objects, it's time to export the model, saving all of your changes.
Click &quot;Export objects&quot; and give the MD3 a nice name. You can overwrite the MD3 you imported without problems, by the way.

A pop-up will appear asking for an &quot;Internal name&quot;. Unless you're editing a player model, ignore this - leave it blank.
Just click &quot;OK&quot;.

==Recap==
To recap the tutorial stated above, here are the basic steps:
# Import objects
# Alter name (remember, FORWARD slashes)
# Export objects

==See also==
* [[Darkplaces material system]]
* [[Texture]]

[[Category:Tutorials]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Tutorials:Understanding a VIS and Hint brushes</title>
    <ns>0</ns>
    <id>267</id>
      <sha1>pgyxrduar38vb2vsnspddlliejb1d94</sha1>
    <revision>
      <id>2582</id>
      <timestamp>2012-08-09T15:22:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{imported|Nick &quot;jex&quot; Jansens|http://tremmapping.pbworks.com/w/page/22453205/Understanding%20Vis%20and%20Hint%20Brushes}}  ==Basic Vis Theory== When ''q3map2'' compiles a map,...&quot;</comment>
      <text xml:space="preserve" bytes="5350">{{imported|Nick &quot;jex&quot; Jansens|http://tremmapping.pbworks.com/w/page/22453205/Understanding%20Vis%20and%20Hint%20Brushes}}

==Basic Vis Theory==
When ''q3map2'' compiles a map, it cuts it up into vis &quot;portals&quot;. These portals may be as big as a room, or as small as only a few units big, depending on how you build your map. The vis process is entirely dependant on these portals. The compiler will look at each individual portal, and attempt to draw a straight line from any point within that portal to any point with every other portal in the map. If a line can be drawn from Portal A to even the furthest edge of Portal B, everything within Portal B will be rendered by the engine while the player is anywhere within Portal A.

Hint brushes can be used to divide the default vis portals into smaller more efficient shapes to help reduce the amount of polygons the engine is rendering that can not actually be seen by the player.

==Visual Vis Theory==
Here is a typical example of how ''q3map2'' creates vis portals:

[[File:tutorial_understanding_vis_fig-1_a.jpg|alt=|link=]].


In this example Player's line of sight is limited to Rooms A and B but the engine is still rendering Room C. 

This is because Room C can be seen from a small part of the vis portal Player is in:

[[File:tutorial_understanding_vis_fig-1_b.jpg|alt=|link=]]


Here Player's line of sight still includes both Room A and B but Room C is no longer being drawn by the engine. 

This is because a straight line cannot be made from Player's current vis portal to that of Room C without intersecting with Structural Brushes.

[[File:tutorial_understanding_vis_fig-1_c.jpg|alt=|link=]]

Now the Player's line of sight no longer includes Room B but because Player is still within the same vis portal to which Room B is visible the engine continues to do the work of rendering it:

[[File:tutorial_understanding_vis_fig-1_d.jpg|alt=|link=]]


==Optimising Vis with Hint Brushes==
Here is the same example with hint brushes added to optimise the Vis:

[[File:tutorial_understanding_vis_fig-2_a.jpg|alt=|link=]]


We can see here that while everything in Player's line of sight is still being rendered, because of the addition of Hint Brushes, now Rooms A and C are no longer being needlessly rendered.

[[File:tutorial_understanding_vis_fig-2_b.jpg|alt=|link=]]


In this example Hint Brushes are preventing the engine from rendering Room B:

[[File:tutorial_understanding_vis_fig-2_c.jpg|alt=|link=]]

With Player in Room C the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render.

[[File:tutorial_understanding_vis_fig-2_d.jpg|alt=|link=]]


==Improper Hint Brush use==
Here is the same example with improper hint brushes added:

[[File:tutorial_understanding_vis_fig-3_a.jpg|alt=|link=]]


Where with proper hinting Rooms A and C can be completely cut out of the Vis, here only a small corner of Room C is not being rendered. The concave angles of the hint brushes between Player and Room C has allowed a straight path to exists between Player's vis portal and that of Room C resulting in almost the entire room being rendered. Between Player and Room A the hint brush doesn't touch the inside corner of the hallway and Room A is also rendered by the engine.

[[File:tutorial_understanding_vis_fig-3_b.jpg|alt=|link=]]


As in the previous example, the same problem exists from around the corner where the hint brush allows a straight line to exist between Player's vis portal and that of Room 

[[File:tutorial_understanding_vis_fig-3_c.jpg|alt=|link=]]


Here the results are less severe, but still unnecessary.

[[File:tutorial_understanding_vis_fig-3_d.jpg|alt=|link=]]


==Irregular Hint Brush use==
In this example the hinting is done somewhat irregularly but still with good results. Some cases will call for more irregular hinting.

[[File:tutorial_understanding_vis_fig-4_a.jpg|alt=|link=]]


As before Rooms A and C are not being rendered. It is okay for the Hint Brushes to overlap Structural Brushes or to create a convex line with other hint brushes. (Note: because the engine does not allow concave volumes to exist, the overlap of the Hint Brush and Structural Brushes between Player and Room A would cause at least 2 vis portals to be created within the Hint Brush. This will not reduce its effectiveness.)

[[File:tutorial_understanding_vis_fig-4_b.jpg|alt=|link=]]


Here again the Hint Brush between Player and Room B performs adequately if not optimally.

[[File:tutorial_understanding_vis_fig-4_c.jpg|alt=|link=]]


As before the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render but with slightly inferior results.

[[File:tutorial_understanding_vis_fig-4_d.jpg|alt=|link=]]


==Creating Hint Brushes==
Hint brushes are created by making a regular brush and simply applying the '''textures/common/hint''' material to it.
 
When optimising the Vis horizontally, ensure that your Hint Brushes fully extended from the bottom of a room to the top to prevent any unnecessary straight paths between portals from existing either above or below your Hint Brushes. The same applies when optimising the Vis vertically. Ensure that your Hint Brushes fully extend from Structural wall to Structural wall.

==See also==
* [[VIS]]
* [[PVS|Potentially viewable set]]

{{finished}}</text>
    </revision>
    <revision>
      <id>2588</id>
      <timestamp>2012-08-09T15:49:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Creating Hint Brushes */</comment>
      <text xml:space="preserve" bytes="5341">{{imported|Nick &quot;jex&quot; Jansens|http://tremmapping.pbworks.com/w/page/22453205/Understanding%20Vis%20and%20Hint%20Brushes}}

==Basic Vis Theory==
When ''q3map2'' compiles a map, it cuts it up into vis &quot;portals&quot;. These portals may be as big as a room, or as small as only a few units big, depending on how you build your map. The vis process is entirely dependant on these portals. The compiler will look at each individual portal, and attempt to draw a straight line from any point within that portal to any point with every other portal in the map. If a line can be drawn from Portal A to even the furthest edge of Portal B, everything within Portal B will be rendered by the engine while the player is anywhere within Portal A.

Hint brushes can be used to divide the default vis portals into smaller more efficient shapes to help reduce the amount of polygons the engine is rendering that can not actually be seen by the player.

==Visual Vis Theory==
Here is a typical example of how ''q3map2'' creates vis portals:

[[File:tutorial_understanding_vis_fig-1_a.jpg|alt=|link=]].


In this example Player's line of sight is limited to Rooms A and B but the engine is still rendering Room C. 

This is because Room C can be seen from a small part of the vis portal Player is in:

[[File:tutorial_understanding_vis_fig-1_b.jpg|alt=|link=]]


Here Player's line of sight still includes both Room A and B but Room C is no longer being drawn by the engine. 

This is because a straight line cannot be made from Player's current vis portal to that of Room C without intersecting with Structural Brushes.

[[File:tutorial_understanding_vis_fig-1_c.jpg|alt=|link=]]

Now the Player's line of sight no longer includes Room B but because Player is still within the same vis portal to which Room B is visible the engine continues to do the work of rendering it:

[[File:tutorial_understanding_vis_fig-1_d.jpg|alt=|link=]]


==Optimising Vis with Hint Brushes==
Here is the same example with hint brushes added to optimise the Vis:

[[File:tutorial_understanding_vis_fig-2_a.jpg|alt=|link=]]


We can see here that while everything in Player's line of sight is still being rendered, because of the addition of Hint Brushes, now Rooms A and C are no longer being needlessly rendered.

[[File:tutorial_understanding_vis_fig-2_b.jpg|alt=|link=]]


In this example Hint Brushes are preventing the engine from rendering Room B:

[[File:tutorial_understanding_vis_fig-2_c.jpg|alt=|link=]]

With Player in Room C the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render.

[[File:tutorial_understanding_vis_fig-2_d.jpg|alt=|link=]]


==Improper Hint Brush use==
Here is the same example with improper hint brushes added:

[[File:tutorial_understanding_vis_fig-3_a.jpg|alt=|link=]]


Where with proper hinting Rooms A and C can be completely cut out of the Vis, here only a small corner of Room C is not being rendered. The concave angles of the hint brushes between Player and Room C has allowed a straight path to exists between Player's vis portal and that of Room C resulting in almost the entire room being rendered. Between Player and Room A the hint brush doesn't touch the inside corner of the hallway and Room A is also rendered by the engine.

[[File:tutorial_understanding_vis_fig-3_b.jpg|alt=|link=]]


As in the previous example, the same problem exists from around the corner where the hint brush allows a straight line to exist between Player's vis portal and that of Room 

[[File:tutorial_understanding_vis_fig-3_c.jpg|alt=|link=]]


Here the results are less severe, but still unnecessary.

[[File:tutorial_understanding_vis_fig-3_d.jpg|alt=|link=]]


==Irregular Hint Brush use==
In this example the hinting is done somewhat irregularly but still with good results. Some cases will call for more irregular hinting.

[[File:tutorial_understanding_vis_fig-4_a.jpg|alt=|link=]]


As before Rooms A and C are not being rendered. It is okay for the Hint Brushes to overlap Structural Brushes or to create a convex line with other hint brushes. (Note: because the engine does not allow concave volumes to exist, the overlap of the Hint Brush and Structural Brushes between Player and Room A would cause at least 2 vis portals to be created within the Hint Brush. This will not reduce its effectiveness.)

[[File:tutorial_understanding_vis_fig-4_b.jpg|alt=|link=]]


Here again the Hint Brush between Player and Room B performs adequately if not optimally.

[[File:tutorial_understanding_vis_fig-4_c.jpg|alt=|link=]]


As before the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render but with slightly inferior results.

[[File:tutorial_understanding_vis_fig-4_d.jpg|alt=|link=]]


==Creating Hint Brushes==
Hint brushes are created by making a regular brush and simply applying the '''common/hint''' material to it.
 
When optimising the Vis horizontally, ensure that your Hint Brushes fully extended from the bottom of a room to the top to prevent any unnecessary straight paths between portals from existing either above or below your Hint Brushes. The same applies when optimising the Vis vertically. Ensure that your Hint Brushes fully extend from Structural wall to Structural wall.

==See also==
* [[VIS]]
* [[PVS|Potentially viewable set]]

{{finished}}</text>
    </revision>
    <revision>
      <id>2646</id>
      <timestamp>2012-09-03T05:35:31Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* See also */</comment>
      <text xml:space="preserve" bytes="5316">{{imported|Nick &quot;jex&quot; Jansens|http://tremmapping.pbworks.com/w/page/22453205/Understanding%20Vis%20and%20Hint%20Brushes}}

==Basic Vis Theory==
When ''q3map2'' compiles a map, it cuts it up into vis &quot;portals&quot;. These portals may be as big as a room, or as small as only a few units big, depending on how you build your map. The vis process is entirely dependant on these portals. The compiler will look at each individual portal, and attempt to draw a straight line from any point within that portal to any point with every other portal in the map. If a line can be drawn from Portal A to even the furthest edge of Portal B, everything within Portal B will be rendered by the engine while the player is anywhere within Portal A.

Hint brushes can be used to divide the default vis portals into smaller more efficient shapes to help reduce the amount of polygons the engine is rendering that can not actually be seen by the player.

==Visual Vis Theory==
Here is a typical example of how ''q3map2'' creates vis portals:

[[File:tutorial_understanding_vis_fig-1_a.jpg|alt=|link=]].


In this example Player's line of sight is limited to Rooms A and B but the engine is still rendering Room C. 

This is because Room C can be seen from a small part of the vis portal Player is in:

[[File:tutorial_understanding_vis_fig-1_b.jpg|alt=|link=]]


Here Player's line of sight still includes both Room A and B but Room C is no longer being drawn by the engine. 

This is because a straight line cannot be made from Player's current vis portal to that of Room C without intersecting with Structural Brushes.

[[File:tutorial_understanding_vis_fig-1_c.jpg|alt=|link=]]

Now the Player's line of sight no longer includes Room B but because Player is still within the same vis portal to which Room B is visible the engine continues to do the work of rendering it:

[[File:tutorial_understanding_vis_fig-1_d.jpg|alt=|link=]]


==Optimising Vis with Hint Brushes==
Here is the same example with hint brushes added to optimise the Vis:

[[File:tutorial_understanding_vis_fig-2_a.jpg|alt=|link=]]


We can see here that while everything in Player's line of sight is still being rendered, because of the addition of Hint Brushes, now Rooms A and C are no longer being needlessly rendered.

[[File:tutorial_understanding_vis_fig-2_b.jpg|alt=|link=]]


In this example Hint Brushes are preventing the engine from rendering Room B:

[[File:tutorial_understanding_vis_fig-2_c.jpg|alt=|link=]]

With Player in Room C the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render.

[[File:tutorial_understanding_vis_fig-2_d.jpg|alt=|link=]]


==Improper Hint Brush use==
Here is the same example with improper hint brushes added:

[[File:tutorial_understanding_vis_fig-3_a.jpg|alt=|link=]]


Where with proper hinting Rooms A and C can be completely cut out of the Vis, here only a small corner of Room C is not being rendered. The concave angles of the hint brushes between Player and Room C has allowed a straight path to exists between Player's vis portal and that of Room C resulting in almost the entire room being rendered. Between Player and Room A the hint brush doesn't touch the inside corner of the hallway and Room A is also rendered by the engine.

[[File:tutorial_understanding_vis_fig-3_b.jpg|alt=|link=]]


As in the previous example, the same problem exists from around the corner where the hint brush allows a straight line to exist between Player's vis portal and that of Room 

[[File:tutorial_understanding_vis_fig-3_c.jpg|alt=|link=]]


Here the results are less severe, but still unnecessary.

[[File:tutorial_understanding_vis_fig-3_d.jpg|alt=|link=]]


==Irregular Hint Brush use==
In this example the hinting is done somewhat irregularly but still with good results. Some cases will call for more irregular hinting.

[[File:tutorial_understanding_vis_fig-4_a.jpg|alt=|link=]]


As before Rooms A and C are not being rendered. It is okay for the Hint Brushes to overlap Structural Brushes or to create a convex line with other hint brushes. (Note: because the engine does not allow concave volumes to exist, the overlap of the Hint Brush and Structural Brushes between Player and Room A would cause at least 2 vis portals to be created within the Hint Brush. This will not reduce its effectiveness.)

[[File:tutorial_understanding_vis_fig-4_b.jpg|alt=|link=]]


Here again the Hint Brush between Player and Room B performs adequately if not optimally.

[[File:tutorial_understanding_vis_fig-4_c.jpg|alt=|link=]]


As before the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render but with slightly inferior results.

[[File:tutorial_understanding_vis_fig-4_d.jpg|alt=|link=]]


==Creating Hint Brushes==
Hint brushes are created by making a regular brush and simply applying the '''common/hint''' material to it.
 
When optimising the Vis horizontally, ensure that your Hint Brushes fully extended from the bottom of a room to the top to prevent any unnecessary straight paths between portals from existing either above or below your Hint Brushes. The same applies when optimising the Vis vertically. Ensure that your Hint Brushes fully extend from Structural wall to Structural wall.

==See also==
* [[VIS]]
* [[PVS]]

{{finished}}</text>
    </revision>
    <revision>
      <id>2906</id>
      <timestamp>2012-11-23T01:26:35Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="5329">{{imported|Nick &quot;jex&quot; Jansens|http://tremmapping.pbworks.com/w/page/22453205/Understanding%20Vis%20and%20Hint%20Brushes}}
{{TOCRIGHT}}

==Basic Vis Theory==
When ''q3map2'' compiles a map, it cuts it up into vis &quot;portals&quot;. These portals may be as big as a room, or as small as only a few units big, depending on how you build your map. The vis process is entirely dependant on these portals. The compiler will look at each individual portal, and attempt to draw a straight line from any point within that portal to any point with every other portal in the map. If a line can be drawn from Portal A to even the furthest edge of Portal B, everything within Portal B will be rendered by the engine while the player is anywhere within Portal A.

Hint brushes can be used to divide the default vis portals into smaller more efficient shapes to help reduce the amount of polygons the engine is rendering that can not actually be seen by the player.

==Visual Vis Theory==
Here is a typical example of how ''q3map2'' creates vis portals:

[[File:tutorial_understanding_vis_fig-1_a.jpg|alt=|link=]].


In this example Player's line of sight is limited to Rooms A and B but the engine is still rendering Room C. 

This is because Room C can be seen from a small part of the vis portal Player is in:

[[File:tutorial_understanding_vis_fig-1_b.jpg|alt=|link=]]


Here Player's line of sight still includes both Room A and B but Room C is no longer being drawn by the engine. 

This is because a straight line cannot be made from Player's current vis portal to that of Room C without intersecting with Structural Brushes.

[[File:tutorial_understanding_vis_fig-1_c.jpg|alt=|link=]]

Now the Player's line of sight no longer includes Room B but because Player is still within the same vis portal to which Room B is visible the engine continues to do the work of rendering it:

[[File:tutorial_understanding_vis_fig-1_d.jpg|alt=|link=]]


==Optimising Vis with Hint Brushes==
Here is the same example with hint brushes added to optimise the Vis:

[[File:tutorial_understanding_vis_fig-2_a.jpg|alt=|link=]]


We can see here that while everything in Player's line of sight is still being rendered, because of the addition of Hint Brushes, now Rooms A and C are no longer being needlessly rendered.

[[File:tutorial_understanding_vis_fig-2_b.jpg|alt=|link=]]


In this example Hint Brushes are preventing the engine from rendering Room B:

[[File:tutorial_understanding_vis_fig-2_c.jpg|alt=|link=]]

With Player in Room C the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render.

[[File:tutorial_understanding_vis_fig-2_d.jpg|alt=|link=]]


==Improper Hint Brush use==
Here is the same example with improper hint brushes added:

[[File:tutorial_understanding_vis_fig-3_a.jpg|alt=|link=]]


Where with proper hinting Rooms A and C can be completely cut out of the Vis, here only a small corner of Room C is not being rendered. The concave angles of the hint brushes between Player and Room C has allowed a straight path to exists between Player's vis portal and that of Room C resulting in almost the entire room being rendered. Between Player and Room A the hint brush doesn't touch the inside corner of the hallway and Room A is also rendered by the engine.

[[File:tutorial_understanding_vis_fig-3_b.jpg|alt=|link=]]


As in the previous example, the same problem exists from around the corner where the hint brush allows a straight line to exist between Player's vis portal and that of Room 

[[File:tutorial_understanding_vis_fig-3_c.jpg|alt=|link=]]


Here the results are less severe, but still unnecessary.

[[File:tutorial_understanding_vis_fig-3_d.jpg|alt=|link=]]


==Irregular Hint Brush use==
In this example the hinting is done somewhat irregularly but still with good results. Some cases will call for more irregular hinting.

[[File:tutorial_understanding_vis_fig-4_a.jpg|alt=|link=]]


As before Rooms A and C are not being rendered. It is okay for the Hint Brushes to overlap Structural Brushes or to create a convex line with other hint brushes. (Note: because the engine does not allow concave volumes to exist, the overlap of the Hint Brush and Structural Brushes between Player and Room A would cause at least 2 vis portals to be created within the Hint Brush. This will not reduce its effectiveness.)

[[File:tutorial_understanding_vis_fig-4_b.jpg|alt=|link=]]


Here again the Hint Brush between Player and Room B performs adequately if not optimally.

[[File:tutorial_understanding_vis_fig-4_c.jpg|alt=|link=]]


As before the Hint Brushes limit the amount of the hallway between Rooms A and B that the engine has to render but with slightly inferior results.

[[File:tutorial_understanding_vis_fig-4_d.jpg|alt=|link=]]


==Creating Hint Brushes==
Hint brushes are created by making a regular brush and simply applying the '''common/hint''' material to it.
 
When optimising the Vis horizontally, ensure that your Hint Brushes fully extended from the bottom of a room to the top to prevent any unnecessary straight paths between portals from existing either above or below your Hint Brushes. The same applies when optimising the Vis vertically. Ensure that your Hint Brushes fully extend from Structural wall to Structural wall.

==See also==
* [[VIS]]
* [[PVS]]

{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>VIS</title>
    <ns>0</ns>
    <id>239</id>
      <sha1>tlbmavryoi1uk2vefsnsxj5857ks8b2</sha1>
    <revision>
      <id>2514</id>
      <timestamp>2012-08-09T09:50:14Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{WIP}} {{need screenshot}} {{grammar}} VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. VI...&quot;</comment>
      <text xml:space="preserve" bytes="2884">{{WIP}}
{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. VIS are one of most notable optimisations for games, it provides opportunity to cull off any stuff that is not visible from a particular position. For large levels, this will cut off from processing more than 90% of stuff.

VIS can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. In real code this is of course not that simple. All map surfaces and objects will have a portal they are standing at.

===Building the VIS===

VIS data being created at BSP stage, the first stage of map compilation. During this phase portals are created, but have no links (so they are dont know what portals are visible to them). 

All gometry with solid material will define a shape for portals. Defining a shape sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from VIS creation. The only entity that breaks VIS is [[func_group]].

There is two types of VIS breaking:
* Solid break - a wall that is blocking anything behind it
* Portal break - a corridor corner, creating new portal

====Leak====
Stub!

====VIS stage====
Second stage of map compilation (called VIS stage) is building links between portals. This could take much time of using full cycle (checking visibility from each portal to each portal). There is faster variant of VIS building, called fast VIS - it only links portal which have common side, giving slightly worse links but just several seconds compile time.

{{tip|Blood Omnicide is always using fast VIS.}}

===Optimizing VIS===

It is important that VIS portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have small RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing VIS tree is one of task map designed should care of.

Things map designer do during optimization of VIS:
* Mark brushes that should not break VIS as detail
* Place hint brushes in order to make new joint VIS breaks for more accurate culling

Optimizing VIS is one of the tasks map designer should care about.

===Using VIS===
VIS data is used by engine client part to control [[PVS]], which is used for rendering culling and network culling.

Engine's server part is using VIS for checking AI visibilitry and explosions;

VIS data is also used during LIGHT stage for faster lightmap tracing.

==See also==
* [[PVS|Potentially visible set]]
* [[Network culling]]

[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2515</id>
      <timestamp>2012-08-09T09:50:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2894">{{WIP}}
{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. VIS are one of most notable optimisations for games, it provides opportunity to cull off any stuff that is not visible from a particular position. For large levels, this will cut off from processing more than 90% of stuff.

VIS can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. In real code this is of course not that simple. All map surfaces and objects will have a portal they are standing at.

===Building the VIS===

VIS data being created at BSP stage, the first stage of map compilation. During this phase portals are created, but have no links (so they are dont know what portals are visible to them). 

All gometry with solid material will define a shape for portals. Defining a shape sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from VIS creation. The only entity that breaks VIS is [[func_group]].

There is two types of VIS breaking:
* Solid break - a wall that is blocking anything behind it
* Portal break - a corridor corner, creating new portal

====Leak====
Stub!

====VIS stage====
Second stage of map compilation (called VIS stage) is building links between portals. This could take much time of using full cycle (checking visibility from each portal to each portal). There is faster variant of VIS building, called fast VIS - it only links portal which have common side, giving slightly worse links but just several seconds compile time.

{{tip|Blood Omnicide is always using fast VIS.}}

===Optimizing VIS===

It is important that VIS portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have small RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing VIS tree is one of task map designed should care of.

Things map designer do during optimization of VIS:
* Mark brushes that should not break VIS as detail
* Place hint brushes in order to make new joint VIS breaks for more accurate culling

Optimizing VIS is one of the tasks map designer should care about.

===Using VIS===
VIS data is used by engine client part to control [[PVS]], which is used for rendering culling and network culling.

Engine's server part is using VIS for checking AI visibilitry and explosions;

VIS data is also used during LIGHT stage for faster lightmap tracing.

==See also==
* [[PVS|Potentially visible set]]
* [[Network culling]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2584</id>
      <timestamp>2012-08-09T15:37:19Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1727">{{WIP}}
{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. Vis can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building the VIS===
Vis portals is crated during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. It is sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
Stub!

===Optimizing VIS===
It is important that portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing portals is one of task map designed should care of.

Things map designer can do to optimize VIS portals:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]</text>
    </revision>
    <revision>
      <id>2634</id>
      <timestamp>2012-08-10T09:37:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2605">{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. Vis can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building the VIS===
Vis portals is crated during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. It is sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires map to be internally sealed. So it can know what part of the map is inside, and what is outside. When some inner part of the map is connected with void, map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and what part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing portals is one of task map designed should care of.

Things map designer can do to optimize VIS portals:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2635</id>
      <timestamp>2012-08-10T09:37:18Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2606">{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. Vis can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building the VIS===
Vis portals is created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. It is sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires map to be internally sealed. So it can know what part of the map is inside, and what is outside. When some inner part of the map is connected with void, map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and what part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing portals is one of task map designed should care of.

Things map designer can do to optimize VIS portals:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2644</id>
      <timestamp>2012-09-03T05:27:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>/* Optimizing VIS */</comment>
      <text xml:space="preserve" bytes="2606">{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. Vis can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building the VIS===
Vis portals is created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. It is sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires map to be internally sealed. So it can know what part of the map is inside, and what is outside. When some inner part of the map is connected with void, map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and what part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing portals is one of task map designer should care of.

Things map designer can do to optimize VIS portals:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2645</id>
      <timestamp>2012-09-03T05:27:26Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Optimizing VIS */</comment>
      <text xml:space="preserve" bytes="2553">{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. Vis can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building the VIS===
Vis portals is created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. It is sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires map to be internally sealed. So it can know what part of the map is inside, and what is outside. When some inner part of the map is connected with void, map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and what part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing portals is one of task map designer should care of:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2647</id>
      <timestamp>2012-09-03T06:01:55Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="3159">{{need screenshot}}
{{grammar}}
VIS stands for visibility. Its a name of map compilation phase, and data created during this phase and used for visibility checking. Vis can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building the VIS===
Vis portals is created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. It is sometimes called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires map to be internally sealed. So it can know what part of the map is inside, and what is outside. When some inner part of the map is connected with void, map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and what part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree should be balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps us to save some processing time, we should not allow it to take that time for its own processing). Optimizing portals is one of task map designer should care of:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

== Console variables ==
{{cvar|r_lockvisibility|disables visibility updates so you can walk around and inspect what is visible from locked position.}}
{{cvar|r_drawportals|draw portal surfaces in different colors.}}
{{cvar|r_novis|Disable visibility info (whole level will be drawn).}}
{{cvar|r_useportalculling|Improve framerate of r_novis by using portal culling. Still not as good as precompiled visibility data, but it helps on complex maps. A value of 2 will force portal culling even if VIS data is presented, which improves framerate on maps witout too much complexity but hurts on complex maps.}}

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2751</id>
      <timestamp>2012-10-08T14:09:11Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="3193">{{need screenshot}}
{{grammar checked|darth}}
VIS (stands for visibility) - name of a map compilation phase during which and data is created and used for visibility checking. VIS can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building VIS===
VIS portals are created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. This process sometimes is called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires the map to be internally sealed so it can distinguish what part of the map is inside and what is outside. When some inner part of the map is connected with void, the map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and which part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of the map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree is balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps to save some processing time, it should not be allowed to take that time for its own processing). Optimizing portals is one of tasks map designer should care of:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

== Console variables ==
{{cvar|r_lockvisibility|disables visibility updates so you can walk around and inspect what is visible from locked position.}}
{{cvar|r_drawportals|draw portal surfaces in different colors.}}
{{cvar|r_novis|Disable visibility info (whole level will be drawn).}}
{{cvar|r_useportalculling|Improve framerate of r_novis by using portal culling. Still not as good as precompiled visibility data, but it is helpful on complex maps. A value of 2 will force portal culling even if VIS data is presented, which improves framerate on maps without too much complexity but hurts on complex maps.}}

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2752</id>
      <timestamp>2012-10-08T14:09:31Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="3195">{{need screenshot}}
{{grammar checked|darth}}
VIS (stands for *visibility*) - name of a map compilation phase during which and data is created and used for visibility checking. VIS can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building VIS===
VIS portals are created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. This process sometimes is called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires the map to be internally sealed so it can distinguish what part of the map is inside and what is outside. When some inner part of the map is connected with void, the map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and which part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of the map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree is balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps to save some processing time, it should not be allowed to take that time for its own processing). Optimizing portals is one of tasks map designer should care of:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

== Console variables ==
{{cvar|r_lockvisibility|disables visibility updates so you can walk around and inspect what is visible from locked position.}}
{{cvar|r_drawportals|draw portal surfaces in different colors.}}
{{cvar|r_novis|Disable visibility info (whole level will be drawn).}}
{{cvar|r_useportalculling|Improve framerate of r_novis by using portal culling. Still not as good as precompiled visibility data, but it is helpful on complex maps. A value of 2 will force portal culling even if VIS data is presented, which improves framerate on maps without too much complexity but hurts on complex maps.}}

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
    <revision>
      <id>2753</id>
      <timestamp>2012-10-08T14:09:43Z</timestamp>
      <contributor>
        <username>Twinchenzo</username>
        <id>3</id>
      </contributor>
      <text xml:space="preserve" bytes="3197">{{need screenshot}}
{{grammar checked|darth}}
VIS (stands for ''visibility'') - name of a map compilation phase during which and data is created and used for visibility checking. VIS can be estimated as a group of areas called portals with each portal having a link to all other postals visible from it. If entity standing in a portal that is visible from a portal of current eye position, it will get drawn.

===Building VIS===
VIS portals are created during BSP stage, links are established during VIS stage.

Structural brushes will define a shape for portals to fill. This process sometimes is called 'breaking VIS' because by nature it is breaking space for visible and not visible zones. All entities (including [[BModel|bmodels]]]) are meant to be changed/removed at any time, so they are always excluded from portals creation. The only entity that breaks VIS is [[func_group]].

====Leak====
VIS requires the map to be internally sealed so it can distinguish what part of the map is inside and what is outside. When some inner part of the map is connected with void, the map is leaked. When a leak occurs, the tools cannot know which part of the level is inside, and which part is outside, and portals cannot have visibility data generated.
Most notable mistakes leading to leak:
* Small gaps between brushes leading to a void
* Detail brushes and entities being used as structural walls (they are not blocking VIS)
* Entities placed outside of the map hull
When map compiler detects a leak, it will stop making portals and cast an error. Map editor will show the spot where leak was occured.
{{tip|Map compiler is using entities to determine what map part is inside. If your map have no entities, compiler will cast a leak error because it cannot decide what part of the map is inside.}}

===Optimizing VIS===
It is important that portal tree is balanced. It should be detailed enough to make accurate culling, and it should be small enough to have less RAM overhead and small processing time (VIS helps to save some processing time, it should not be allowed to take that time for its own processing). Optimizing portals is one of tasks map designer should care of:
* Mark small brushes that should not break VIS as detail (Detail brushes are opposed to Structural)
* Place hint brushes that will make additional portals for more accurate culling

== Console variables ==
{{cvar|r_lockvisibility|disables visibility updates so you can walk around and inspect what is visible from locked position.}}
{{cvar|r_drawportals|draw portal surfaces in different colors.}}
{{cvar|r_novis|Disable visibility info (whole level will be drawn).}}
{{cvar|r_useportalculling|Improve framerate of r_novis by using portal culling. Still not as good as precompiled visibility data, but it is helpful on complex maps. A value of 2 will force portal culling even if VIS data is presented, which improves framerate on maps without too much complexity but hurts on complex maps.}}

==Tutorials==
* [[Tutorials:Understanding a VIS and Hint brushes|Understanding a VIS and Hint brushes]]

==See also==
* [[PVS|Potentially visible set]]

__NOTOC__
[[Category:Glossary]]
[[Category:Darkplaces engine]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Vertex lighting</title>
    <ns>0</ns>
    <id>157</id>
      <sha1>nq8yf7xlby5xuagl95mjx98plz1e3as</sha1>
    <revision>
      <id>1950</id>
      <timestamp>2012-07-27T11:05:42Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]] Vertex-based lighting is technique to sample light at s...&quot;</comment>
      <text xml:space="preserve" bytes="1433">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small convex objects
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some [[RAM]] but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Realtime lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]</text>
    </revision>
    <revision>
      <id>1952</id>
      <timestamp>2012-07-27T11:07:05Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1443">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small convex objects
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some [[RAM]] but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Realtime lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>1955</id>
      <timestamp>2012-07-27T11:09:50Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1419">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small convex objects
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some [[RAM]] but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
__NOTOC__</text>
    </revision>
    <revision>
      <id>2273</id>
      <timestamp>2012-07-30T20:40:39Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="1432">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small convex objects
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some [[RAM]] but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2665</id>
      <timestamp>2012-09-25T12:43:04Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Usage of vertex lighting */</comment>
      <text xml:space="preserve" bytes="1433">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small convex objects:
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some [[RAM]] but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2666</id>
      <timestamp>2012-09-25T12:44:54Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <comment>/* Usage of vertex lighting */</comment>
      <text xml:space="preserve" bytes="1426">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small objects:
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some [[RAM]] but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2758</id>
      <timestamp>2012-10-10T10:21:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1425">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small objects:
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some memory but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>2760</id>
      <timestamp>2012-10-10T10:21:13Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1425">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small objects:
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, muchrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant/Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some memory but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
    <revision>
      <id>3610</id>
      <timestamp>2013-02-20T19:11:37Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="1425">[[File:Lightmap_vs_vertexlight.jpg|right|thumb|500px|Lightmaps (on the left) in comparison with vertex-based lighting]]
Vertex-based lighting is technique to sample light at surface vertices and apply [http://en.wikipedia.org/wiki/Gouraud_shading Gouraud shading] during rendering.

Vertex lighting is most simple and fast lighting, it is used to store only low frequency data and will look bad at complex objects.

In Darkplaces engine, vertex lighting are part of map static lighting and being calculated each time map is compiled.

== Usage of vertex lighting ==
{| cellspacing=0 cellpadding=2 width=500
| width:50% align=right | Small objects:
| width:50% | &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | Foliage (grass, mushrooms etc.): 
| &lt;font color=green&gt;OK&lt;/font&gt;
|-
| align=right | [[BModel | Brush models]]: 
|&lt;font color=orange&gt;Use with care, artifacts may occur&lt;/font&gt;
|-
| align=right | Whole map:
| &lt;font color=red&gt;lots of artifacts&lt;/font&gt;
|-
| align=right | Terrain: 
| &lt;font color=red&gt;lack of shadows&lt;/font&gt;
|-
| align=right | [[Radiant/Glossary | Point entities]]:
| &lt;font color=red&gt;not applicable&lt;/font&gt;
|}

== Console variables ==
{{cvar|mod_q3bsp_nolightmaps|do not load lightmaps in [[Q3BSP]] maps, saves some memory but looks ugly}}

==See also==
* [[Darkplaces lighting]]
* [[Lightmap]]
* [[Lightgrid]]

[[Category:Darkplaces engine]]
[[Category:Glossary]]
[[Category:Lighting]]
{{finished}}
__NOTOC__</text>
    </revision>
  </page>
  <page>
    <title>WYSIWYG</title>
    <ns>0</ns>
    <id>662</id>
      <sha1>lsuta0xhcj0qelxgp017pijelxqw0y0</sha1>
    <revision>
      <id>3680</id>
      <timestamp>2013-10-02T12:02:45Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;WYSIWYG is an acronym for &quot;What You See Is What You Get&quot;. It is a system that lets user to see how editing results appear in final produce version.  In games development, WYSI...&quot;</comment>
      <text xml:space="preserve" bytes="996">WYSIWYG is an acronym for &quot;What You See Is What You Get&quot;. It is a system that lets user to see how editing results appear in final produce version.

In games development, WYSIWYG is an interface that allows developer to view results that is very close to what we will se in the final version of the game. 

==WYSIAWYG==
There is also a variation of WYSIWYG term, WYSIAWYG (&quot;What You See Is Almost What You Get&quot;) which means that only a part if editing results are shown. Most of game tools really using WYSIAWYG systems because of problems of full implementation of WYSIWYG. 

WYSIAWYG centers around most noticed editing result properties (properties that are important to the developer). For instance, a light source radius and color are important properties because they sets the look of scene (the whole goal of making lighting), shadows and per-pixel rendering are less noticeable so can be sacrificed for the implementation simplicity of WYSIAWYG editor.

[[Category:Glossary]]
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Wolf</title>
    <ns>0</ns>
    <id>580</id>
      <sha1>1fkonvxob7ahgkhwfp068z5evdkkv5t</sha1>
    <revision>
      <id>3281</id>
      <timestamp>2012-11-30T13:26:57Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;{{BoEnemy|out|Bo enemy wolf.gif|The wolf}} Wolf are weakest specimen of Nosgoth's fauna. Bites it's enemies. Original game have 3 enemies using wolf model.  ==Stats== :Health:...&quot;</comment>
      <text xml:space="preserve" bytes="809">{{BoEnemy|out|Bo enemy wolf.gif|The wolf}}
Wolf are weakest specimen of Nosgoth's fauna. Bites it's enemies. Original game have 3 enemies using wolf model.

==Stats==
:Health: 4
:Damage: 3
:Blood: red
:Walk speed: fast
:Character type: animal
:Entity: [[enemy_wolf]]
{{BoEnemy|out|Bo enemy dog.gif|The dog}}
==The Dog==
Brown-colored weaker version of wolf which can be encountered near human settlements.
:Health: 2
:Damage: 3
:Entity: [[enemy_dog]]

==Dark Eden wolves==
Near a Dark Eden an enhanced version of wolf can be encountered (in original game it looks exactly the same as normal wolves).
:Health: 8
:Damage: 6

==Concept art gallery==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

__NOEDITSECTION__
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3282</id>
      <timestamp>2012-11-30T13:27:08Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="806">{{BoEnemy|out|Bo enemy wolf.gif|The wolf}}
Wolf are weakest specimen of Nosgoth's fauna. Bites it's enemies. Blood Omen have 3 enemies using wolf model.

==Stats==
:Health: 4
:Damage: 3
:Blood: red
:Walk speed: fast
:Character type: animal
:Entity: [[enemy_wolf]]
{{BoEnemy|out|Bo enemy dog.gif|The dog}}
==The Dog==
Brown-colored weaker version of wolf which can be encountered near human settlements.
:Health: 2
:Damage: 3
:Entity: [[enemy_dog]]

==Dark Eden wolves==
Near a Dark Eden an enhanced version of wolf can be encountered (in original game it looks exactly the same as normal wolves).
:Health: 8
:Damage: 6

==Concept art gallery==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

__NOEDITSECTION__
__NOTOC__
{{finished}}</text>
    </revision>
    <revision>
      <id>3519</id>
      <timestamp>2013-01-24T15:26:47Z</timestamp>
      <contributor>
        <username>Makenor13</username>
        <id>7</id>
      </contributor>
      <text xml:space="preserve" bytes="813">{{BoEnemy|out|Bo enemy wolf.gif|The wolf}}
Wolves are weakest specimen of Nosgoth's fauna. They bite their enemies. Blood Omen have 3 enemies using wolf model.

==Stats==
:Health: 4
:Damage: 3
:Blood: red
:Walk speed: fast
:Character type: animal
:Entity: [[enemy_wolf]]
{{BoEnemy|out|Bo enemy dog.gif|The dog}}
==The Dog==
Brown-colored weaker version of wolf which can be encountered near human settlements.
:Health: 2
:Damage: 3
:Entity: [[enemy_dog]]

==Dark Eden wolves==
Near a Dark Eden an enhanced version of wolf can be encountered (in original game it looks exactly the same as normal wolves).
:Health: 8
:Damage: 6

==Concept art gallery==
&lt;gallery&gt;
File:Enigma wolf.jpg
File:Enigma dog.png
File:Hedgenok wolf.jpg
File:BO-Concept-Art-WolfConcept.JPG
&lt;/gallery&gt;

__NOEDITSECTION__
__NOTOC__
{{finished}}</text>
    </revision>
  </page>
  <page>
    <title>Worldspawn</title>
    <ns>0</ns>
    <id>272</id>
      <sha1>axvhp8xnkqi0q4nq4mjegmfwg8catct</sha1>
    <revision>
      <id>2667</id>
      <timestamp>2012-09-25T13:20:17Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <comment>Created page with &quot;Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. Keys of worldspawn are used to set global map configuration. World is a big model, and only one model...&quot;</comment>
      <text xml:space="preserve" bytes="2117">Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. Keys of worldspawn are used to set global map configuration. World is a big model, and only one model that used [[VIS]] and other culling optimisations for rendering.

In QuakeC, worldspawn keys is read-only, they cannot be changed once map is compiled.

===World keys list===
{{entity fields begin}}
|-
| Map title
| message 
| Map name used in console. For savegames and game UI Blood Omnicide stores localized map name in [[Translation|translation]] scripts.
|-
| Min light
| _minlight 
| Lightmap/lightgrid/vertex lighy minimal level. Makes map darkest areas to look brighter, useful for outdoor maps.
|-
| Min grid light
| _mingridlight 
| Explicit minlight for lightgrid.
|-
| Lightgrid size
| gridsize
| Size of lightgrid cell, lesser size = more lightgrid points = more detailed lightgrid.
|-
| Lightgrid mix
| gridmix
| When set, lightgrid's ambient and direct lightning will be mixed together to amount of given fraction (0.3 - 30%, 0.5 - 50% etc.);
|-
| Ambient occlusion
| _aoMode
| Use ambient occlusion for lightmaps. Can be one of values:
* empty - no ambient occlusion
* 2 low quality (48 vectors)
* 3 high quality (164 vectors)
|-
| AO Depth
| _aoDepth
| This number of units trace should pass in order to get maximum ambient lighting. 8, 16, 32 are usual values. More depth = more dark.
|-
| AO Depth Exponent
| _aoDepthExponent
| Depth exponent is used as a power of trace distance checks. Default is 2. Lower values will soften ao effect.
|-
| AO Gain
| _aoGain
| Gain makes sharp corners brighter, its an additive value. Gain is added once more than half of all ambient traces succeed. Default is 1.
|-
| AO Gain Mask
| _aoGainMask
| RGB mask used for Gain. 1 0 0 will make gain zones to be red.
|-
| AO Scale
| _aoScale
| Scale darkens zones with not enough ambient lighting. Its a multiplier which is always lesser than 1.
|-
| AO Scale Mask
| _aoScaleMask
| RGB mask used for scale processing, using inverse color (1 0.5 1 will make green).
{{entity fields end}}

=See also=
*[func_group]

[[Category:Entity templates]]</text>
    </revision>
    <revision>
      <id>2668</id>
      <timestamp>2012-09-25T15:28:00Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2119">Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. Keys of worldspawn are used to set global map configuration. World is a big model, and only one model that used [[VIS]] and other culling optimisations for rendering.

In QuakeC, worldspawn keys is read-only, they cannot be changed once map is compiled.

===World keys list===
{{entity fields begin}}
|-
| Map title
| message 
| Map name used in console. For savegames and game UI Blood Omnicide stores localized map name in [[Translation|translation]] scripts.
|-
| Min light
| _minlight 
| Lightmap/lightgrid/vertex lighy minimal level. Makes map darkest areas to look brighter, useful for outdoor maps.
|-
| Min grid light
| _mingridlight 
| Explicit minlight for lightgrid.
|-
| Lightgrid size
| gridsize
| Size of lightgrid cell, lesser size = more lightgrid points = more detailed lightgrid.
|-
| Lightgrid mix
| gridmix
| When set, lightgrid's ambient and direct lightning will be mixed together to amount of given fraction (0.3 - 30%, 0.5 - 50% etc.);
|-
| Ambient occlusion
| _aoMode
| Use ambient occlusion for lightmaps. Can be one of values:
* empty - no ambient occlusion
* 2 low quality (48 vectors)
* 3 high quality (164 vectors)
|-
| AO Depth
| _aoDepth
| This number of units trace should pass in order to get maximum ambient lighting. 8, 16, 32 are usual values. More depth = more dark.
|-
| AO Depth Exponent
| _aoDepthExponent
| Depth exponent is used as a power of trace distance checks. Default is 2. Lower values will soften ao effect.
|-
| AO Gain
| _aoGain
| Gain makes sharp corners brighter, its an additive value. Gain is added once more than half of all ambient traces succeed. Default is 1.
|-
| AO Gain Mask
| _aoGainMask
| RGB mask used for Gain. 1 0 0 will make gain zones to be red.
|-
| AO Scale
| _aoScale
| Scale darkens zones with not enough ambient lighting. Its a multiplier which is always lesser than 1.
|-
| AO Scale Mask
| _aoScaleMask
| RGB mask used for scale processing, using inverse color (1 0.5 1 will make green).
{{entity fields end}}

=See also=
*[[func_group]]

[[Category:Entity templates]]</text>
    </revision>
    <revision>
      <id>2669</id>
      <timestamp>2012-09-25T15:28:38Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2121">Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. World is a big model, and only one model that used [[VIS]] and other culling optimisations for rendering.

Keys of worldspawn are used to set global map configuration. 

In QuakeC, worldspawn keys is read-only, they cannot be changed once map is compiled.

===World keys list===
{{entity fields begin}}
|-
| Map title
| message 
| Map name used in console. For savegames and game UI Blood Omnicide stores localized map name in [[Translation|translation]] scripts.
|-
| Min light
| _minlight 
| Lightmap/lightgrid/vertex lighy minimal level. Makes map darkest areas to look brighter, useful for outdoor maps.
|-
| Min grid light
| _mingridlight 
| Explicit minlight for lightgrid.
|-
| Lightgrid size
| gridsize
| Size of lightgrid cell, lesser size = more lightgrid points = more detailed lightgrid.
|-
| Lightgrid mix
| gridmix
| When set, lightgrid's ambient and direct lightning will be mixed together to amount of given fraction (0.3 - 30%, 0.5 - 50% etc.);
|-
| Ambient occlusion
| _aoMode
| Use ambient occlusion for lightmaps. Can be one of values:
* empty - no ambient occlusion
* 2 low quality (48 vectors)
* 3 high quality (164 vectors)
|-
| AO Depth
| _aoDepth
| This number of units trace should pass in order to get maximum ambient lighting. 8, 16, 32 are usual values. More depth = more dark.
|-
| AO Depth Exponent
| _aoDepthExponent
| Depth exponent is used as a power of trace distance checks. Default is 2. Lower values will soften ao effect.
|-
| AO Gain
| _aoGain
| Gain makes sharp corners brighter, its an additive value. Gain is added once more than half of all ambient traces succeed. Default is 1.
|-
| AO Gain Mask
| _aoGainMask
| RGB mask used for Gain. 1 0 0 will make gain zones to be red.
|-
| AO Scale
| _aoScale
| Scale darkens zones with not enough ambient lighting. Its a multiplier which is always lesser than 1.
|-
| AO Scale Mask
| _aoScaleMask
| RGB mask used for scale processing, using inverse color (1 0.5 1 will make green).
{{entity fields end}}

=See also=
*[[func_group]]

[[Category:Entity templates]]</text>
    </revision>
    <revision>
      <id>2670</id>
      <timestamp>2012-09-25T15:32:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2143">Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. World is a big model, and only one model that used [[VIS]] and other culling optimisations for rendering.

Keys of worldspawn are used to set global map configuration. 

In QuakeC, worldspawn keys is read-only, they cannot be changed once map is compiled.

===World keys list===
{{entity fields begin}}
|-
| Map title
| message 
| Map name used in console. For savegames and game UI Blood Omnicide stores localized map name in [[Translation|translation]] scripts.
|-
| Min light
| _minlight 
| Lightmap/lightgrid/vertex lighy minimal level. Makes map darkest areas to look brighter, useful for outdoor maps.
|-
| Min grid light
| _mingridlight 
| Explicit minlight for lightgrid.
|-
| Lightgrid size
| gridsize
| Size of lightgrid cell, lesser size = more lightgrid points = more detailed lightgrid.
| 64 64 128
|-
| Lightgrid mix
| gridmix
| When set, lightgrid's ambient and direct lightning will be mixed together to amount of given fraction (0.3 - 30%, 0.5 - 50% etc.);
| 0
|-
| Ambient occlusion
| _aoMode
| Use ambient occlusion for lightmaps. Can be one of values:
* empty - no ambient occlusion
* 2 low quality (48 vectors)
* 3 high quality (164 vectors)
|-
| AO Depth
| _aoDepth
| This number of units trace should pass in order to get maximum ambient lighting. 8, 16, 32 are usual values. More depth = more dark.
| 128
|-
| AO Depth Exponent
| _aoDepthExponent
| Depth exponent is used as a power of trace distance checks. Lower values will soften ao effect.
| 2
|-
| AO Gain
| _aoGain
| Gain makes sharp corners brighter, its an additive value. Gain is added once more than half of all ambient traces succeed.
| 1
|-
| AO Gain Mask
| _aoGainMask
| RGB mask used for Gain. 1 0 0 will make gain zones to be red.
| 1 1 1
|-
| AO Scale
| _aoScale
| Scale darkens zones with not enough ambient lighting. Its a multiplier which is always lesser than 1.
| 1
|-
| AO Scale Mask
| _aoScaleMask
| RGB mask used for scale processing, using inverse color (1 0.5 1 will make green).
| 1 1 1
{{entity fields end}}

=See also=
*[[func_group]]

[[Category:Entity templates]]</text>
    </revision>
    <revision>
      <id>2680</id>
      <timestamp>2012-09-25T20:50:43Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <text xml:space="preserve" bytes="2145">Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. World is a big model, and only one model that used [[VIS]] and other culling optimisations for rendering.

Keys of worldspawn are used to set global map configuration. 

In QuakeC, worldspawn keys is read-only, they cannot be changed once map is compiled.

===World keys list===
{{entity fields begin}}
|-
| Map title
| message 
| Map name used in console. For savegames and game UI Blood Omnicide stores localized map name in [[Translation|translation]] scripts.
|-
| Min light
| _minlight 
| Lightmap/lightgrid/vertex lighy minimal level. Makes map darkest areas to look brighter, useful for outdoor maps.
|-
| Min grid light
| _mingridlight 
| Explicit minlight for lightgrid.
|-
| Lightgrid size
| gridsize
| Size of lightgrid cell, lesser size = more lightgrid points = more detailed lightgrid.
| 64 64 128
|-
| Lightgrid mix
| gridmix
| When set, lightgrid's ambient and direct lightning will be mixed together to amount of given fraction (0.3 - 30%, 0.5 - 50% etc.);
| 0
|-
| Ambient occlusion
| _aoMode
| Use ambient occlusion for lightmaps. Can be one of values:
* empty - no ambient occlusion
* 2 low quality (48 vectors)
* 3 high quality (164 vectors)
|-
| AO Depth
| _aoDepth
| This number of units trace should pass in order to get maximum ambient lighting. 8, 16, 32 are usual values. More depth = more dark.
| 128
|-
| AO Depth Exponent
| _aoDepthExponent
| Depth exponent is used as a power of trace distance checks. Lower values will soften ao effect.
| 2
|-
| AO Gain
| _aoGain
| Gain makes sharp corners brighter, its an additive value. Gain is added once more than half of all ambient traces succeed.
| 1
|-
| AO Gain Mask
| _aoGainMask
| RGB mask used for Gain. 1 0 0 will make gain zones to be red.
| 1 1 1
|-
| AO Scale
| _aoScale
| Scale darkens zones with not enough ambient lighting. Its a multiplier which is always lesser than 1.
| 1
|-
| AO Scale Mask
| _aoScaleMask
| RGB mask used for scale processing, using inverse color (1 0.5 1 will make green).
| 1 1 1
{{entity fields end}}

=See also=
*[[func_group]]

[[Category:Entity definitions]]</text>
    </revision>
    <revision>
      <id>2682</id>
      <timestamp>2012-09-25T20:52:03Z</timestamp>
      <contributor>
        <username>VorteX</username>
        <id>1</id>
      </contributor>
      <minor/>
      <text xml:space="preserve" bytes="2264">Worldspawn - &quot;The world&quot; entity which holds all non-interactive geometry. In other worlds and static brushes are part of the worldspawn, any dynamic brushes (toggleable walls, trains) are not. World is a big model, and only one model that used [[VIS]] and other culling optimisations for rendering.

Keys of worldspawn are used to set global map configuration. 

In QuakeC, worldspawn keys is read-only, they cannot be changed once map is compiled.

===World keys list===
{{entity fields begin}}
|-
| Map title
| message 
| Map name used in console. For savegames and game UI Blood Omnicide stores localized map name in [[Translation|translation]] scripts.
|-
| Min light
| _minlight 
| Lightmap/lightgrid/vertex lighy minimal level. Makes map darkest areas to look brighter, useful for outdoor maps.
|-
| Min grid light
| _mingridlight 
| Explicit minlight for lightgrid.
|-
| Lightgrid size
| gridsize
| Size of lightgrid cell, lesser size = more lightgrid points = more detailed lightgrid.
| 64 64 128
|-
| Lightgrid mix
| gridmix
| When set, lightgrid's ambient and direct lightning will be mixed together to amount of given fraction (0.3 - 30%, 0.5 - 50% etc.);
| 0
|-
| Ambient occlusion
| _aoMode
| Use ambient occlusion for lightmaps. Can be one of values:
* empty - no ambient occlusion
* 2 low quality (48 vectors)
* 3 high quality (164 vectors)
|-
| AO Depth
| _aoDepth
| This number of units trace should pass in order to get maximum ambient lighting. 8, 16, 32 are usual values. More depth = more dark.
| 128
|-
| AO Depth Exponent
| _aoDepthExponent
| Depth exponent is used as a power of trace distance checks. Lower values will soften ao effect.
| 2
|-
| AO Gain
| _aoGain
| Gain makes sharp corners brighter, its an additive value. Gain is added once more than half of all ambient traces succeed.
| 1
|-
| AO Gain Mask
| _aoGainMask
| RGB mask used for Gain. 1 0 0 will make gain zones to be red.
| 1 1 1
|-
| AO Scale
| _aoScale
| Scale darkens zones with not enough ambient lighting. Its a multiplier which is always lesser than 1.
| 1
|-
| AO Scale Mask
| _aoScaleMask
| RGB mask used for scale processing, using inverse color (1 0.5 1 will make green).
| 1 1 1
{{entity fields end}}

=See also=
*[[func_group]]

[[Category:Entity definitions]]</text>
    </revision>
  </page>
</mediawiki>
